------解决方案-------------------- begin transaction insert into TableB(col2) select col1 from TableA; delete from dbo.TableA ? commit
------解决方案--------------------
------解决方案-------------------- begin tran ? insert into TableB(col2) select col1 from TableA; ? IF @@ROWCOUNT ... ? rollback tran; ? else ? commit tran; ? delete from dbo.TableA ? ? IF @@ROWCOUNT ... ? rollback tran; ? else ? commit tran;