Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Script all the jobs on a SQL server 2005 and apply them in SQL 2008


Script all the jobs on a SQL server 2005 and apply them in SQL 2008

Author
Message
jozwickdb-1026716
jozwickdb-1026716
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 198
hi Amit!
Thank you again for your assistance.
According to your suggestion, I moved line 172 before line 169 and that seems to have resolved the discrepancy for the error checking.

On #2 in my post, I did a search on "schedule_uid" in the original script and replaced with "schedule_id" to change the field so that jobs can be recreated on SQL2005 instead of SQL2008. I ran your script on a test server.

It generated the code to script out all jobs. However, when I went to run it, I received the following:

Msg 209, Level 16, State 1, Line 211
Ambiguous column name 'schedule_id'.

Not sure if I am not understanding something in the logic.
And, no, as I am new to this post, I do not know how to update a submitted script. I did send an email to sqlservercentral and asked. I hope they reply.

Let me know what you think about my schedule_id issue.

Thank you !!
jozwickdb-1026716
jozwickdb-1026716
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 198
Amit,
I heard back from the folks at SQLServerCentral and you are to do the following to edit your script:

If you go into the contribution center and edit it, it will get resubmitted. http://www.sqlservercentral.com/Contributions/Home

Hope this helps.

Looking forward to your response to my #2 question above.
ryanbseattle
ryanbseattle
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 280
A point of note.

If you need to use this script to recover the jobs from a restored copy of msdb that isn't named "msdb", you'll need to recreate/alter the system views dbo.sysjobs_view, and dbo.sysoriginatingservers_view to reflect the restored DB name.

rj
Ryan McCauley
Ryan McCauley
SSC-Enthusiastic
SSC-Enthusiastic (187 reputation)SSC-Enthusiastic (187 reputation)SSC-Enthusiastic (187 reputation)SSC-Enthusiastic (187 reputation)SSC-Enthusiastic (187 reputation)SSC-Enthusiastic (187 reputation)SSC-Enthusiastic (187 reputation)SSC-Enthusiastic (187 reputation)

Group: General Forum Members
Points: 187 Visits: 162
Thanks so much for this script - it's fantastic!

The only issue I ran into is that some of our job names and step names have single quotes in them, which throws off the quoting in the script and causes some issues. To resolve this, I had to make the following change:

Change "@step_name" on line 147 to "REPLACE(@step_name, '''', '''''')"

Otherwise amazing - this script saved hours of work!

Ryan
Iwas Bornready
Iwas Bornready
SSCrazy Eights
SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)

Group: General Forum Members
Points: 8704 Visits: 885
Thanks for the script.
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