You have some T-SQL code that calls a CLR stored procedure which in its turn invokes some T-SQL code. This T-SQL causes an error that aborts the batch, without rolling back the transaction (if there is any). Currently, to my knowing, there are two such errors, of which one is the new ;THROW statement.It turns out that this error cannot be caught, neither in the CLR code, nor in the upper-level SQL code, but the error is always passed to the client. For whatever reason, the error message has a leading newline.One can also note that if the T-SQL code starts a transaction, the transaction survives the ordeal. The normal behaviour when the CLR exits with a different trancount than on entry that the transaction is silently rolled back (if there was no active trans on entry) or raises an error (if there was a trans prior to the call to the CLR.)The behaviour only appears if XACT_ABORT is OFF.
Product Language
Version
Category
Operating System
Operating System Language
Steps to Reproduce
Actual Results
Expected Results
Platform
Virtualization
Please wait...