在事务语句最前面加上 set xact_abort on GO SET QUOTED_IDENTIFIER OFF GO ALTER PROCEDURE [dbo].[test] @a int, @b int, @c int, @d int, @e int, @f int AS set xact_abort on begin tran insert into testtb values(@a,@b,@c,@d) insert into test4 values(@e,@f) commit tra…
create proc USP_CUTTING_TATABLET_PULL_FINISH ( @name NVARCHAR(20) ) as SET XACT_ABORT ON--设置全盘回滚 BEGIN TRAN--开启事务 --------------------------------------这里写功能代码 if(@@ERROR<>0)--判断是否出错 begin rollback tran;--回滚全部 SET XACT_ABORT OFF--释放 end else begin c…