Solved

SQL script to script out all sql jobs

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
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…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

749 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