zoukankan      html  css  js  c++  java
  • 事务

    -------------事务
    declare @zhuan int =1000
    declare @sumerr int =0
    begin transaction --开始事务(告诉数据库事务启动)
    update dbo.bank set balance= balance-@zhuan where cid='0001'
     set @sumerr=@sumerr+@@ERROR
    update dbo.bank set balance= balance+@zhuan where cid='0002'
    set @sumerr=@sumerr+@@ERROR
    if(@sumerr >0)--全局变量,输出错误码(错误码大于零)
        begin
              rollback transaction --回滚事务,放弃事务,放弃操作----失败
        end    
    else
        begin
              
            commit transaction --提交事务--成功
        end   

  • 相关阅读:
    TCP/IP||ARP/RARP
    TCP/IP||IP
    TCP/IP||链路层
    Struts||IQ
    SpringMVC||IQ
    TCP/IP Basic
    Spring||Mails
    Spring||Quartz
    jQuery Ajax 方法应用。
    html5的离线储存应用.
  • 原文地址:https://www.cnblogs.com/sumg/p/3649488.html
Copyright © 2011-2022 走看看