Solved

SQL script to script out all sql jobs

Posted on 2009-07-10
5
317 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
  • 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now