Update Statement
UPDATE t1
SET t1.TargetCol1 = t2.SourceCol1,
t2.TargetCol2 = t2.SourceCol2
FROM Table1 AS t1
INNER JOIN Table2 AS t2 ON t2.PrimaryCol = t1.PrimaryCol
Delete
DELETE TB1 FROM Table1 TB1 INNER JOIN StagingTable ON Table1.Field2 = StagingTable.Field2
UPDATE t1
SET t1.TargetCol1 = t2.SourceCol1,
t2.TargetCol2 = t2.SourceCol2
FROM Table1 AS t1
INNER JOIN Table2 AS t2 ON t2.PrimaryCol = t1.PrimaryCol
Delete
DELETE TB1 FROM Table1 TB1 INNER JOIN StagingTable ON Table1.Field2 = StagingTable.Field2
Comments
Post a Comment