Solved

SQL script to script out all sql jobs

Posted on 2009-07-10
5
331 Views
Last Modified: 2012-06-27
I need a single sql script to script out all existing sql agent jobs.  The scripts need to be the same functionality of the CREATE TO funcationilty in order to be able to recreate the jobs on another server in the event of a system failure.

Any suggestions appreciated!
0
Comment
Question by:ilibhart80
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 17

Expert Comment

by:pssandhu
ID: 24824376
Does this help? I do not have SQL Server 2000 instance running so i cannot test if this does all jobs at once.
http://msdn.microsoft.com/en-us/library/aa177024(SQL.80).aspx
P.
0
 

Author Comment

by:ilibhart80
ID: 24825363
I need to be able to automatically perform the above links steps in a maintenance plan that I can run weekly.  

I need to know how I can have those CREAT scripts stored somewhere as a backup to quickly recreate the jobs if there is a hardware failure.
0
 
LVL 17

Accepted Solution

by:
pssandhu earned 500 total points
ID: 24826355
I do not think there is any straight foward way to do this in SSMS. I think you are better of wrting a small vbscript to interface with the SMO/DMO API to script all jobs to a file. Check this out:
http://social.msdn.microsoft.com/Forums/en-US/sqlsmoanddmo/thread/c2bad100-ac38-42f0-a381-2780d1d5c243
Once successfull you schedule the script execution.
Hope this helps.
P.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 24828661
In order to quickly recreate the jobs right click on Jobs, select "All tasks" and then "Generate SQL Script"
0

Featured Post

 Watch the Recording: Learning MySQL 5.7

MySQL 5.7 has a lot of new features. If you've dabbled with an older version of MySQL, it is definitely worth learning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a large data set and a SSIS package. How can I load this file in multi threading?
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question