我有一组SQL服务器作业,我希望它们的计划是动态的,即我希望下一个运行日期来自一个表。
我尝试更新next_run_date
表中的sysjobschedules
和next_scheduled_run_date
表中的sysjobactivity
,但这没有做任何事情。
我该怎么做?
答案 0 :(得分:3)
我认为您可以使用 - sp_update_schedule
来更新时间表。
sp_update_schedule { [ @schedule_id = ] schedule_id | [ @name = ] 'schedule_name' } [ , [ @new_name = ] new_name ] [ , [ @enabled = ] enabled ] [ , [ @freq_type = ] freq_type ] [ , [ @freq_interval = ] freq_interval ] [ , [ @freq_subday_type = ] freq_subday_type ] [ , [ @freq_subday_interval = ] freq_subday_interval ] [ , [ @freq_relative_interval = ] freq_relative_interval ] [ , [ @freq_recurrence_factor = ] freq_recurrence_factor ] [ , [ @active_start_date = ] active_start_date ] [ , [ @active_end_date = ] active_end_date ] [ , [ @active_start_time = ] active_start_time ] [ , [ @active_end_time = ] active_end_time ] [ , [ @owner_login_name = ] 'owner_login_name' ] [ , [ @automatic_post =] automatic_post ]