I've been doing my talk on try-catch in T-SQL for a while and whining about not being able to "rethrow" (via RAISERROR) a system error. Even went as far as writing a RegEx decoder so that I can copy the error into a user error message text and parse the text back on the client. Two weeks ago in a class, and again this week at TechEd, someone suggested the simple, relatively low-tech solution; "Just add 50000". RAISERROR to rethrow and subtract 50000 at the client. Unless you have already defined user errors in the range that can't be rethrown + 50000 (up to 13000), this should work fine. Thanks for the suggestion.
Over 1000 XEvents in SQL Server 2016 CTP2. Here are the new ones.
Extended events has firmly established itself as the premier diagnostic feature in SQL Server and SQL Server 2016 brings along more events to correspond to
One thought on “Just Add 50000”
Hi Bob,
You’re welcome. Sometimes a background in throwing errors to clients in the VB "classic" COM/ActiveX world comes in handy whilst doing T-SQL 2005 style 😉
Great talks at Tech Ed, I really enjoyed them.
Best regards,
Didier
Comments are closed.