August 15, 2005 at 3:15 pm
Hi,
I'm just curious as to what is best practice in handling errors via checking @@ERROR. At present we check after any statement that alters the database, Insert, Update, Delete.... What I'm interested in finding out is, is it best practice to also do it after any statement that simply acceses the database ie Selects. Should you be doing a IF @@ERROR <> 0 after each select?
Thanks for your comments,
Shawn
August 16, 2005 at 7:10 am
There's just no point in checking for error in a select, it'll either be a fatal error that you can't catch or something like division by 0 error which shouldn't happen all that often and that should be taken care of while designing.
August 16, 2005 at 8:08 am
A great resource for error handling in stored procedures is Erland Sommarskog's article Implementing Error Handling with Stored Procedures.
August 16, 2005 at 2:36 pm
Thanks guys, much appreciated. Remi, those were my initial thoughts but I figured that I had best check with those more knowledgable . Chris the article is great.
Much appreciated.
Cheers,
Shawn
August 16, 2005 at 2:39 pm
Yup this guy is good... Other articles from him that you can't not read :
The Curse and Blessings of Dynamic SQL
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy