Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

How to check TSQL's EXECUTE command for error

$
0
0
Hello,

I am TOTALLY new with TSQL/SQL. consider the code below:

EXECUTE sp_executesql @sql, N'@xmldataOUT xml OUTPUT', @xmldataOUT=@instance OUTPUT;

CREATE XML SCHEMA COLLECTION FASSchema AS @instance

How can:
1. Add a check to the EXECUTE command to see if it fails
2. what is a suitable way to display an error message in case the EXECUTE command fails
3. Add a check to the CREATE command to see if it fails

Your help will be highly appreciated. I need people to jumpstart me

Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>