当前位置: 代码迷 >> ASP >> 关于存储过程中是事务解决办法
  详细解决方案

关于存储过程中是事务解决办法

热度:76   发布时间:2012-02-23 22:01:36.0
关于存储过程中是事务

比如在存储过程里面有两句update

      begin   transaction
      select   *..................
      update   .............
      update   ............
      if   @@error=0
            commit   transaction
      else
            rollback   transaction
当第二个update   出错了,第一个还执行?
    不rollback?

------解决方案--------------------
不会执行的,因为@@error> 0了,只有当二者正确时才执行的:)
  相关解决方案