December 19, 2016 at 3:58 am
Hi
What's the safest way to create a copy of a job (bit like cut and paste; appreciate it's not that simple)
I'd like to archive an old job (as a copy) before making changes to the original
I can find useful info on moving jobs between servers
Can't find anything useful regarding copying on the same server
Thanks
- Damian
December 19, 2016 at 4:01 am
Damian
Just right-click on the job in SSMS, choose Script Job As and use one of the options to generate the script.
John
December 19, 2016 at 4:06 am
Script the job, put the script into source control.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
December 19, 2016 at 4:53 am
Thanks, that is pretty simple!
How does it handle schedules
I see it generates a schedule using @schedule_uid with a uniqueidentifier
If I script out the job, change the name and run it, it reproduces the exact same @schedule_uid value for the new job
Is this correct?
If I change the new schedule, it changes the old schedule
looks like commenting out the schedule id works as it just generates a new one
I'm there with this now, thanks!
- Damian
December 19, 2016 at 5:49 am
DamianC (12/19/2016)
Thanks, that is pretty simple!How does it handle schedules
I see it generates a schedule using @schedule_uid with a uniqueidentifier
If I script out the job, change the name and run it, it reproduces the exact same @schedule_uid value for the new job
Is this correct?
If I change the new schedule, it changes the old schedule
looks like commenting out the schedule id works as it just generates a new one
I'm there with this now, thanks!
Schedules are linked to jobs (or vice versa, as they have a Many to Many relationship) , so yes, this would be expected. You're effectively assigning a new job to the same schedule. This would mean if you amend the schedule on one job, it'll amend the other, as they are indeed, the same schedule.
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply