Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favourite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved in your SSC briefcase from the favorites tab.
Download now (direct download link)

Copy all jobs, job steps and job schedules

By rhandloff,

This vbscript will generate the sql to recreate all the jobs running on a given SQL server. I wrote this because the last time we migrated a SQL server, I ended up re-creating all the jobs, steps and schedules by hand using the Enterprise Manager. It was the slowest, dullest and most error-prone part of the migration. Being a lazy programmer (aren't all good programmers lazy?) and being in love with scripting languages (especially Perl and VBScript) I thought I would throw a quick little script together to do the job.

So, set up a udl and capture the output to a text file. Paste the sql statements into the query analyzer and voila!

You could easily use a connection object to execute the sql as it ran, or save it to a file and then call osql through a command shell, but I chose not to do that since our migration will be stressful enough without worrying that something went wrong with the script. I'd rather see the SQL and paste it into the query analyzer prior to executing the SQL.

Total article views: 748 | Views in the last 30 days: 7
 
Related Articles
FORUM

Migration

MIgration

FORUM

Views(script) migrating

Is there any wizard to migrate views(script) from one database to another database

FORUM

migration

during migration

FORUM

Migration

Migration

BLOG

Taking Script of Sql Server Jobs for Migration

when migration sql server database to a new server, i use the following powershell script to take al...

 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones