Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Shastryv
Posting Yak Master
145 Posts |
Posted - 2005-01-20 : 10:04:56
|
| I am using the following script to change the job schedule dynamically to 8:15AM 8:20AM and 9PM. Even though it's changing the job schedule the job doesn't seems to be kicking off..I appreciate your comment on thisDeclare @Active_Start_Date varchar(15)Select @Active_Start_Date = Active_Start_Date from msdb..sysjobschedules Where Schedule_ID = 137 If DATEPART(dd,GETDATE())Between 20 And 22 --Change it to 12 AND 15 laterUPDATE msdb..sysjobschedulesSET Active_Start_Time = 82000, Next_Run_Date = @Active_Start_Date,Next_Run_Time = 82500Where Schedule_ID = 137 ElseUPDATE msdb..sysjobschedulesSET Active_Start_Time = 210000,Next_Run_Time = 21000Where Schedule_ID = 137 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2005-01-20 : 11:50:21
|
| You would probably have to run sp_sqlagent_notify to tell the agent about the change.But you should do it using sp_update_jobschedule anyway==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|