Solved

SQL script to script out all sql jobs

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
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 and will be exposed to the many uses the SELECT statement has.

920 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