I've seen various posts around the web where they recommend to use construct like:
MERGE T USING S ON 1 = 0 WHEN NOT
MATCHED THEN ... OUTPUT INSERTED.id AS NewId, S.id AS OldId
do an INSERT and be able to collect the newly autoincremented ID and also the source ID at the same time.
I am a bit uneasy about using this solution, given this note on MS site (http://technet.microsoft.com/en-us/library/bb510625.aspx):
"It is important to specify
View Complete Post