Generate script of all jobs

Last week one on of the forums someone wanted to know how to script all jobs in a given instance. The requirement the all jobs should be scripted to one file. We know that right clicking on a job would generate the script for us as in the below screenshot.

But how to script all jobs at one go? SSMS has this option. Click on the Jobs node in SSMS. Then launch Object Explorer Details (View –> Object Explorer Details in SSMS 2005 or just F7 in SSMS 2008). Then select the jobs that need to scripted by holding on to Shift or Ctrl key like we select different files in Windows Explorer.  Then right click and select Script job as.

Voila!  All jobs are scripted a single query!

One thought on “Generate script of all jobs

Comments are closed.