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 GLTROUTPUT DELETED.* INTO GLTR_ARCHIVE WHERE PostDate <= @PurgeDate AND gltrInterfaceDate IS NOT NULL
http://ift.tt/1l7xYP3
No comments:
Post a Comment