February 24, 2014 at 7:15 am
I had a situation where I was running some inserts within a transaction, and needed to issue ROLLBACK because the results did not seem right. I wanted to save some of the results of the inserts to a "save" table somehow, but of course I can't write to a separate table, because the ROLLBACK will undo that also. Is there a way to write/save data somehow, that will not be affected by the rollback ??
February 24, 2014 at 7:26 am
Table variable. Insert into the table variable during the transaction. Table variables aren't affected by explicit rollbacks, after the rollback you can then insert the data into a permanent table.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 24, 2014 at 7:35 am
Thanks
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply