How much priority gives to Exception Handling ?.
-
Friday, February 08, 2013 5:07 AM
Hi,
Can anybody suggest me their idea ?.
-- Bhavesh Thakkar
Sr.Database Administrator
My Blog
Linked In Profile
All Replies
-
Friday, February 08, 2013 5:42 AM
Hi Bhavesh,
IMHO
- Errors or exceptions always happen only when we least expect it.
- Errors or exceptions happen when we are confident that the code we developed is free from errors
So the rule of thumb is give the highest priority to proper exception handling/error logging mechanisms when designing any database systems.
Please read the below articles by Erland for an excellent background on error handling:
Error Handling in SQL 2000 – a Background
Implementing Error Handling with Stored Procedures
Error Handling in SQL 2005 and Later
Krishnakumar S
- Proposed As Answer by Satheesh Variath Friday, February 08, 2013 6:26 AM
- Edited by Krishnakumar S Friday, February 08, 2013 6:33 AM
- Unproposed As Answer by Database Experts Friday, February 08, 2013 6:33 AM
- Proposed As Answer by Naomi NMicrosoft Community Contributor, Moderator Sunday, February 10, 2013 3:27 AM
- Marked As Answer by Iric WenModerator Monday, February 18, 2013 7:12 AM
-
Sunday, February 10, 2013 3:29 AMModerator
The question is not clear. I think if your client application has error handling and your procedure has set xact_abort ON, then you don't need to add an extra TRY/CATCH in the stored procedure itself. At least right now I am working on a C# project and I rely on the method that executes the query or stored procedure to properly handle and log the error.
For every expert, there is an equal and opposite expert. - Becker's Law
My blog- Edited by Naomi NMicrosoft Community Contributor, Moderator Sunday, February 10, 2013 3:29 AM
- Marked As Answer by Iric WenModerator Monday, February 18, 2013 7:12 AM

