码迷,mamicode.com
首页 > 数据库 > 详细

sql语句开启事务

时间:2017-08-09 11:25:42      阅读:294      评论:0      收藏:0      [点我收藏+]

标签:else   logs   back   set   where   log   tran   code   update   

以下为示例代码:

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

 

sql语句开启事务

标签:else   logs   back   set   where   log   tran   code   update   

原文地址:http://www.cnblogs.com/codeDevotee/p/7323966.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!