sql事务

begn transaction

declare @errorsum int

set @errorsum=0

执行语句

set @errorsum=@errorsum+@@error

执行语句

set @errorsum=@errorsum+@@error

 

if(@errorsum<>0)

begin

     rollback transaction

end

else

begin

     commit transaction

end

 

posted @ 2009-01-20 12:35  Dacey  Views(174)  Comments(0Edit  收藏  举报