Created
June 1, 2018 01:11
-
-
Save tdmitch/4cce5627cf42b55de90c8c8a61fd4e2d 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
SELECT ct.ID | |
, e.FirstName | |
, e.MiddleName | |
, e.LastName | |
, ct.SYS_CHANGE_OPERATION [Operation] | |
FROM CHANGETABLE(CHANGES dbo.Emp, @StartVersionID) ct | |
LEFT JOIN dbo.Emp e | |
ON e.ID = ct.ID | |
WHERE (SELECT MAX(v) FROM (VALUES(ct.SYS_CHANGE_VERSION), (ct.SYS_CHANGE_CREATION_VERSION)) AS VALUE(v)) <= @EndVersionID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment