Monday, February 20, 2012

is there an error handler in sql stored procedures?

is there an error handler in sql stored procedures? For example if i want to do a drop something and there is a lock, i want to try return if it droped it or not and if not then try again latererror handling in sql 2000 is pretty poor. basically you have to check @.@.ERROR after every statement that could possibly fail. The situation in 2005 is much better since there you can use try/catch.

for error handling on 2000:
http://www.sommarskog.se/error-handling-I.html
http://www.sommarskog.se/error-handling-II.html

for try/catch:
http://msdn2.microsoft.com/en-us/library/ms175976.aspx

No comments:

Post a Comment