How to script out ALL or FEW SQL Server Jobs using SSMS

Today, I have come across a requirement to generate the sql script for SQL Server Jobs (only few out of thousands). Most of us are familiar with an approach by right click on the sql job and choose ‘Script Job as’ to script out individually, but this is such a tedious job if you have couple of sql jobs to be scripted.

This post explains another simpler way using “Object Explorer Details“. It allows you to select multiple jobs to be scripted as below.

  1. Choose Object Explorer Details Menu from View main menu in SSMS.
  2. Select “SQL Server Agent” -> “Jobs” in Object explorer which lists all the SQL Agent Jobs in Details.
  3. Select the jobs (ALL or FEW) you want to script and then right click to select the scripting option.

The above steps will create all the selected jobs in a single query window as per the selection.

If you enjoyed this blog post, please feel free to share it with your friends!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s