The following article introduces the basics of handling errors in stored procedures. If you are not familiar with the difference between fatal and non-fatal errors, the system function @@ERROR, or how to add a custom error with the system stored procedure sp_addmessage, you should find it interesting.

1. You state that with fatal errors, there is no code you can implement that will allow you to handle them gracefully. This is true, but if you code the Stored Proceedure to use transactions, then the transaction will roll back automatically on fatal error, no? Also, you can configure the Agent to take action on specific (fatal) errors.

2. I would love to have seen a better description of @@RAISEERROR parameters. What is the STATE parameter for, and how can it be used? The NOWAIT option is confusing. If an error is fatal, then the client is notified immmediately, no? Would NOWAIT cause the client to be notified immediately of nonfatal errors, while the Stored Proceedure continues to run?

3. I am hoping you could document a centralised error handling system that takes specific actions depending on the error type. (I have developed my own, but it could be better.) Finally, I can't wait to read your next ADO article.