• The code presented is actually about six months older than the date on it - I've been using this method on around 150 servers since it's inception with no issues.

    Edit:

    FWIW, you can add a PRINT @DynDelete and if you schedule the code through SQLAgent you'll have the delete command output so you can record what is being deleted by having the job step append its output to a file. [My production version of this logs the deletes to a table]

    Your friendly High-Tech Janitor... 🙂