Wednesday, March 21, 2012

Generating script for existing sql jobs

we have a database and we are planning to deploy the database on another Box. I have database tables,stored procedures,views,user defined functions,triggers and some jobs on this database. So instead of restoring a back of this database we are planning to create the whole environment by using the sql scrtipts. So I know how to generate the sql script for all the objects(using generate sql script at database level) but how can I get the script for my Sql Jobs. How can I copy all the sql jobs onto the the new Box.

Thanks.In Enterprise Manager, if you right click on the job and select "all tasks" you will be able to generate a script for that job.

If you have many jobs to move, you could do a restore of the msdb database on your new server since the SQL Server Agent jobs are maintained in the msdb database.

No comments:

Post a Comment