Self Deleting Job

  • Comments posted to this topic are about the item Self Deleting Job

  • You could also use the @delete_level parameter of sp_add_job.

    0 = Never

    1 = On success

    2 = On failure

    3 = Always

    When using SSMS to create/modify the properties of a job this appears on the Notifications page "Automatically delete job:" with a dropdown to choose when the job will be deleted.

  • Wow.. some simple, and somehow I missed that.

    Thank you for your input. This shows you that there are many ways to skin a cat, and some of us choose the most convoluted way.


  • You're welcome Miguel. This won’t be the first (or last) time any of us find ourselves in this situation. The reason I knew about the delete level is from working on a system that created and ran many jobs throughout the day, some as often as every five minutes. Setting the delete level to delete the jobs upon success allowed the system to keep itself cleaned up. Any jobs that failed would stick around and the job output could then be used to investigate why they failed.

  • Thanks for the script.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply