34,590
社区成员
发帖
与我相关
我的任务
分享
if @@error<>0 --判断修改数据有没有出错
begin --如果出错
rollback tran bcd -- 回滚事务到 BCD 的还原点
commit tran ok --提交事务
end
else --出错
commit tran ok --提交事务
begin tran ok --开始一个事务
delete from rxqz where qz= 'rx015 ' --删除数据
save tran bcd --保存一个事务点
update sz set name='李丽s' where name= '李丽'--修改数据
if @@error=0 --判断修改数据有没有出错
begin --如果出错
rollback tran bcd -- 回滚事务到 BCD 的还原点
commit tran ok --提交事务
end
else --出错
commit tran ok --提交事务
begin tran ok --开始一个事务 OK
delete from rxqz where qz= 'rx015 ' --删除数据
save tran bcd --保存一个事务点 命名为 bcd
update sz set name='李丽s' where name= '李丽'--修改数据
if @@error=0 --判断修改数据有没有出错
begin --如果出错
rollback tran bcd -- 回滚事务到 BCD 的还原点
commit tran ok --提交事务
end
else --出错
commit tran ok --提交事务