首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

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

2012-02-23 
关于存储过程中是事务 比如在存储过程里面有两句updatebegintransactionselect*..................update.

关于存储过程中是事务

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

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

[解决办法]
不会执行的,因为@@error> 0了,只有当二者正确时才执行的:)

热点排行