Can SQL try-catch block discarded CLR errors?

We use SQL 2005 and a try-catch function to handle all of our error handling in the database. We are currently working on deploying a .NET CLR function to make some WCF calls to the database. This WCF procedure is written to the CLR and then deployed to SQL. If I put a try-catch block in the CLR code, it will catch the error in order. However, I cannot present an error before the try-catch block in SQL. SQL seems to ignore what I throw and catches the error it finds. Is there between these two relationships (i.e. I can’t transfer from one to the other?)

If I can drop from the CLR to the calling procedure in SQL, is any special formatting required? I tried a specific case of catching the error that was selected, and then threw another error, but SQL ignored my abandoned error and caught the original error, as if it had ignored the error that occurred.

+3
source share
1 answer

Here's a blog post that covers it at a high level: Exception Handling in SQLCLR

SQL- //, CLR ( ), . , , TSQL, .

, -, , .

+2

Source: https://habr.com/ru/post/1697401/


All Articles