Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2006
    Posts
    8

    Unanswered: 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 later

  2. #2
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    error 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •