SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


script out 2005 SQLAgent jobs


script out 2005 SQLAgent jobs

Author
Message
george sibbald
george sibbald
SSC Guru
SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)

Group: General Forum Members
Points: 99454 Visits: 13710
Hi, I'm on the scrounge.

I need to automate a process to script out all SQLAgent jobs on a 2005 server. I understand you need to do this in sqldmo or VB, which I am not conversant in.

does anyone out there have a script\process to do this?

thanks in advance

george

---------------------------------------------------------------------
Sugesh Kumar
Sugesh Kumar
One Orange Chip
One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)

Group: General Forum Members
Points: 26083 Visits: 373
Check if this helps u.

http://technet.microsoft.com/en-us/library/ms191450.aspx

Cheers,
Sugeshkumar Rajendran
SQL Server MVP
http://sugeshkr.blogspot.com
Sugesh Kumar
Sugesh Kumar
One Orange Chip
One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)

Group: General Forum Members
Points: 26083 Visits: 373
This below link does exactly what you need.

http://www.sqlmag.com/Article/ArticleID/38790/sql_server_38790.html

Cheers,
Sugeshkumar Rajendran
SQL Server MVP
http://sugeshkr.blogspot.com
george sibbald
george sibbald
SSC Guru
SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)

Group: General Forum Members
Points: 99454 Visits: 13710
Sugesh, thanks for trying but I need to script out ALL the jobs and the first URL is the SSMS method to script out a single job and the second site requires that I pay to subscribe to get the code (as its a trade mag), and its for SQL 2000 anyway (don't know if it would still work)

If anyone has code for SQL 2005 I would appreciate it.

george

---------------------------------------------------------------------
Adam Haines
Adam Haines
SSC-Insane
SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)

Group: General Forum Members
Points: 22159 Visits: 3135
George,

Open SSMS click on jobs and in the Object Explorer Details Windows you will see a list of jobs. You can highlight all the jobs and right click --> script job as --> Create to --> new file or new query window.

This will script all selected jobs to a single file or a new query window.



My blog: http://jahaines.blogspot.com
Adam Haines
Adam Haines
SSC-Insane
SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)

Group: General Forum Members
Points: 22159 Visits: 3135
Sorry did not read your post in full; I missed automated. Why does this process need to be automated? Are you moving the jobs to another server?

One option is to use the transfer jobs task in SSIS, if you are moving the jobs to another database.



My blog: http://jahaines.blogspot.com
george sibbald
george sibbald
SSC Guru
SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)

Group: General Forum Members
Points: 99454 Visits: 13710
Adam, thankyou so much. I thought there must be a way to do this in SSMS as it was possible in enterprise manager. Unfortunatly to me things are not as obvious in SSMS, using SSMS is a different way of thinking, which is not as intuitive to me yet as I have no history using VS. MS favouring developers again. Don't get me started on SSIS.

...and you'f think this would be mentioned by MS at http://technet.microsoft.com/en-us/library/ms191450.aspx



Now for a way to automate the scripting process anyone...................

---------------------------------------------------------------------
george sibbald
george sibbald
SSC Guru
SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)

Group: General Forum Members
Points: 99454 Visits: 13710
adam, our last posts crossed...

I need to automate it because I have a log shipped server with multiple databases, log shipping in both directions. I might need to fail over one database or all of them... so I would prefer to have the jobs scripted out so I can recreate the ones I need easily, as opposed to having them actually being loaded onto the standby server.

I could bever get the transfer job task to work in DTS, does it actually work in SSIS?

---------------------------------------------------------------------
Adam Haines
Adam Haines
SSC-Insane
SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)

Group: General Forum Members
Points: 22159 Visits: 3135
I could bever get the transfer job task to work in DTS, does it actually work in SSIS?


I haven't had any problems with the transfer jobs task. SSIS is a much more scalable solution than its predecessor DTS; however, it has many features that make it more time consuming to learn.



My blog: http://jahaines.blogspot.com
Sugesh Kumar
Sugesh Kumar
One Orange Chip
One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)

Group: General Forum Members
Points: 26083 Visits: 373
You have the zip file containing the code there hope u have missed to see the file over there.

Cheers,
Sugeshkumar Rajendran
SQL Server MVP
http://sugeshkr.blogspot.com
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum









































































































































































SQLServerCentral


Search