The Generate Script for sp_purge_jobhistory!

I have created a small script for generating sp_purge_jobhistory for my SQL jobs at work. The first part of script generate system store procedure for purge history of jobs where is condition (WHERE sjs.next_run_date = CONVERT(VARCHAR(10), DATEADD(dd, 0, @v),112)) - that means select all sql jobs which runs very often!

Script is below:

Result looks like this.

(click the picture)

Here is second part of the script.

See you next time!

  • Grey Twitter Icon
  • Grey Facebook Icon
  • Grey LinkedIn Icon

© 2020 All rights reserved. | Filip Holub

  • Twitter Social Icon
  • Facebook Social Icon
  • LinkedIn Social Icon