Why does Sql Server keep executing after raiserror when xact_abort is on?

后端 未结 4 1167
猫巷女王i
猫巷女王i 2020-12-23 16:01

I just got surprised by something in TSQL. I thought that if xact_abort was on, calling something like

raiserror(\'Something bad happened\', 16, 1);
         


        
4条回答
  •  梦毁少年i
    2020-12-23 16:21

    Use RETURN immediately after RAISERROR() and it'll not execute the procedure further.

提交回复
热议问题