It is easy to provide informational error messages that a person can understand. Just RAISERROR with descriptive text. itβs a little harder to pick up localized texts, which implies the proper use of sp_addmessage and family. The real difficult problem is that there is an error with which the program may react. This means correctly documented error codes (both severity and condition), as well as tight code discipline when using them in your API.
And do not forget about the correct nesting of transactions. I have a sample of my blog on how to properly handle transactions in conjunction with T-SQL exceptions : Exception handling and nested transactions .
, / T-SQL . , T-SQL, , . . SQL Server: . , 50000, , "" .