What is wrong with my Try Catch in T-SQL?

后端 未结 6 652
轻奢々
轻奢々 2020-12-16 15:19

I am using SQL Server 2008 and when I run this Statement in Management studio the Select statement in the Catch Block is executed as expected

BEGIN TRY
 INSE         


        
6条回答
  •  我在风中等你
    2020-12-16 16:00

    This has bitten me in the past as well.

    Not all errors generated inside the TRY block statements are passed into the CATCH block. Any errors with a severity of 10 or less are considered to be warnings and do not cause control to flow to the CATCH block. Also, any errors that break the database connection will not cause the CATCH block to be reached. There may be other situations as well.

提交回复
热议问题