日期:2014-05-19  浏览次数:20606 次

大家帮忙,这是什么意思save tran和rollback tran save_point
declare   @tranname   varchar(32)
select   @tranname= 'mytran '
begin   tran   @tranname
delete   from   products   where   productid=1
save   tran   save_point
delete   from   details   where   productid=1
if   @@error=0   then
begin
rollback   tran   save_point
commit   tran   mytran
end  
else
commit   tran   mytran
go

------解决方案--------------------
save tran save_point--设置事务保存点
rollback tran save_point ---回滚到事务保存点