woensdag 16 maart 2011

Scripting jobs sql2008, fun issue

Ofcourse always know what you are doing when well...when u do anything but never assume stuff...

Like i did with this example, if u decide to copy a job in the sqlserveragent (sql2008) by scripting the job and then run it under a different name on the same instance (change jobname in script) then u have 2 jobs which have the same jobsteps / schedules.
Only difference is the name.

Don't assume u can change the schedule in the newly created job and it will only apply for that job.
Nope, the fact that u scripted it from an existing job makes it have the same schedule_id and thus if u change the schedule properties for job 2 u will also change the schedule properties for job 1.
U can delete the schedule of a job, the schedule itself will still exist but will not be referenced to that job anymore.

Its a different discussion on why u want to do this in the first place (getting a base layout for a new job with lots of jobsteps in our case) but don't assume its a different and unique object all together.

Geen opmerkingen:

Een reactie posten