Chapter 7. Error Handling
Great designers aren't afraid of complexity, and some of the best are drawn to it. But their goal is to make the seemingly complex simple.
—Steve McConnell[1]
[1] McConnell, Steve. After the Gold Rush. Redmond, WA: Microsoft Press, 1999. Page 26.
In this chapter we'll talk about the conventional ways of raising and handling errors in stored procedures, as well as some of the quirks you may run into with Transact-SQL error management. Transact-SQL's error-handling facilities work reasonably well, but they don't always work in the most logical fashion or as consistently as we might like. Even if you're careful to add error-handling code to every stored procedure on your server, you can't rely on it to work 100% of the ...
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