存储过程事务回滚写法

begin tran at01 begin try

----业务逻辑语句

 commit tran at01 end try
 begin catch
rollback tran at01
INSERT INTO t_log (ErrorMessage,ErrorSeverity,ErrorState,operator_type,operate_content,[operate_date])VALUES(ERROR_MESSAGE(),ERROR_SEVERITY(),ERROR_STATE(),'0','失败',GETDATE())
end catch 

 

posted @ 2017-11-24 10:21  夏雨曦  阅读(717)  评论(0编辑  收藏  举报