Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When migrating servers, how can I easily script all my SQL Server Jobs onto a new machine?


Not accepting "backup msdb" as the answer.

share|improve this question
up vote 3 down vote accepted

In SQL Management Studio:

  • Click on the jobs folder in Object Explorer
  • Display the Object Explorer Details window (under View menu)
  • Select all or some of your jobs
  • Right-click, script job as Create To New Query Window
  • Change the connection of your query window to the new server
  • Execute the generated script(s)

There you go!

Note: this is for SQL 2005+. SQL 2000 Enterprise Manager has an option to Generate Scripts on the Job Agent, I believe.

share|improve this answer
Yup, found this on the SQL Server Central too ( – Nathan Bedford Jul 23 '09 at 14:23
Review the resulting scripts carefully. I've forgotten the details, but I hit a situation in SQL 2005 where a GUID was generated in the SSMS script for the JobId, and the script then checked for the existance of that GUID when the job was being loaded. Not too useful if you run the script a second time on the machine, since the job name will be duplicated... – Philip Kelley Jul 23 '09 at 20:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.