SQL Server作业动态计划 [英] SQL server job dynamic schedule

查看:147
本文介绍了SQL Server作业动态计划的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组SQL Server作业,并且我希望它们的时间表是动态的,即我希望下一个运行日期来自表格.

I have a set of SQL server jobs and I want the schedule for them to be dynamic i.e. I want the next run date to come from a table.

我尝试更新sysjobschedules表中的next_run_datesysjobactivity表中的next_scheduled_run_date,但这没有任何作用.

I have tried updating next_run_date in the sysjobschedules table and next_scheduled_run_date in sysjobactivity table but this doesn't do anything.

我将如何处理?

推荐答案

我认为您可以使用-sp_update_schedule更新计划.

I think you can use - sp_update_schedule to update the 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 ]

这篇关于SQL Server作业动态计划的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆