Friday, February 08, 2013 5:07 AM
Friday, February 08, 2013 5:42 AM
- 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 2005 and Later
- 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 AMModeratorThe 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