wardster (8/21/2010)
In Mel's example in the original article, he deletes from his staging table after committing the transaction which inserts into the target table and updates the source table, and even explicitly comments the fact to stress it's importance:--Don't delete from temp table until transaction is committed
DELETE @TempSource
Does this matter?
With a table variable, no. It's not affected by transactions. But, if you look at the comment, it looks like the author may have used a Temp Table originally and changed it to a table variable later on. It could matter if it's a Temp Table (although I've not studied the code well enough to know for sure in this case).
--Jeff Moden
Change is inevitable... Change for the better is not.