事务处理

set @errornum=0
begin transaction
update Student set name='ewfeeeeeeeeeeeeeeeeeeeeeeeee' where id='1'
set @errornum=@errornum+@@ERROR

if(@errornum=0)
    begin 
    commit transaction
    end
else
begin
rollback transaction
print 'woaini'
end
select * from Student where id='1'


exec sp_databases
declare @Studnet int
set @Studnet=243
exec sp_helptext @Studnet

 

posted @ 2013-06-04 09:46  张国朋  阅读(115)  评论(0编辑  收藏  举报