Inside Microsoft® SQL Server® 2008: T-SQL Programming
by Dejan Sarka Itzik Ben-Gan Greg Low, Roger Wolter, Ed Katibah, and Isaac Kunen
Chapter 6. Error Handling
Itzik Ben-Gan
When you develop T-SQL code, you need to take into consideration situations in which your code might fail. SQL Server provides you with tools to handle errors and take corrective measures. The area of error handling with T-SQL was improved dramatically only recently. SQL Server 2005 introduced the TRY/CATCH constructs, which was a big leap forward. Even though some important aspects of error handling in T-SQL are still missing, SQL Server 2008 did not add any improvements in this area. I hope that the next major release of SQL Server will add more features and improvements in this area.
To help you appreciate the benefits of using the TRY/CATCH construct I’ll first describe the problematic nature of handling ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access