TSQL: Try-Catch Transaction in Trigger

后端 未结 9 1654
长发绾君心
长发绾君心 2020-12-05 08:09

I am trying to put a try-catch statement inside a trigger using Microsoft Server 2005.

BEGIN TRANSACTION
BEGIN TRY
    --Some More SQL
    COMMIT TRANSACTION         


        
9条回答
  •  渐次进展
    2020-12-05 08:45

    Isn't the best way but it works. Start a new transaction and do the normal commit rollback and begin another transaction in the end for implicit transaction commit

    http://msdn.microsoft.com/en-us/library/ms187844(v=SQL.90).aspx

提交回复
热议问题