문제

I have two SQL Agent jobs that share the same schedule due to an error I made during the creation of the second job. I generated a script in SSMS and edited some values, but I left the schedule_uid the same. Now it turns out that while those two jobs are running at the same time, they are corrupting each other's data.

What I need to do is leave the original job alone, but create a new schedule and have the second job use this new schedule. However, my searches for the correct way to do this have all resulted in dead-ends.

None of this can be done using a UI .. it all must be scripted so it can be run during a maintenance window without me present.

Thanks in advance for any assistance.

도움이 되었습니까?

해결책

Use msdb.dbo.sp_detach_schedule followed by msdb.dbo.sp_add_jobschedule.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top