sql语句开启事务

以下为示例代码:

begin tran
  update 表
     set A的钱=A的钱+100 where 姓名='A'
  update 表
     set B的钱=B的钱-100 where 姓名='B'
if @@error<>0
  rollback
else
  commit

 

posted @ 2017-08-09 10:42  沉迷编程的程序员  阅读(1210)  评论(0编辑  收藏  举报