Friday, February 21, 2014

Add comparison to roll back transaction?

If your goal it to be sure that records deleted from GLTR are inserted to GLTR_ARCHIVE, there is better way to do it.



DELETE FROM GLTR
OUTPUT DELETED.* INTO GLTR_ARCHIVE
WHERE PostDate <= @PurgeDate AND gltrInterfaceDate IS NOT NULL

Please read:

http://ift.tt/1l7xYP3







No comments:

Post a Comment