Created
January 22, 2016 13:09
-
-
Save anonymous/4610396193fe8c2c6874 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MERGE etl.Change_Tracking_Version AS target | |
USING ( | |
SELECT 'Emp' [Table_Name] | |
, ? [Version_ID] -- Get the change tracking version ID | |
) AS source | |
ON target.Table_Name = source.Table_Name | |
WHEN MATCHED | |
THEN UPDATE | |
SET target.Change_Tracking_Version = source.Version_ID | |
WHEN NOT MATCHED | |
THEN INSERT (Table_Name, Change_Tracking_Version) | |
VALUES (source.Table_Name, source.Version_ID); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment