事务处理

begin transaction
insert into ...
save transaction first  /*事务保留点*/
insert into ...
if @@error <> 0 rollback transaction first
insert into ...
if @@error <> 0 rollback transaction first
insert into ...
if @@error <> 0 rollback transaction first
commit transaction
posted @ 2012-02-04 15:35  Yu  阅读(114)  评论(0编辑  收藏  举报