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

关于存储过程中是事务

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

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

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