常用SQL之:存储过程事务回滚
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
小人才疏学浅,看官不喜勿喷,谢谢