我正在嘗試使用Microsoft SQL Server 2008的添加計劃執行時間間隔。我正在進行特定操作,並且我想要時間運行weekly once sunday midnight
。我的@freq_type
是8,因爲它每週運行,而@freq_subday_type
是1,因爲我希望它在特定時間運行。但是,這也可以應用於daily once midnight
。我不希望它看起來一樣。我怎樣才能使星期日更具體,指定它必須是星期天這是一個特定的日子。指定sp_add_schedule(Transact-SQL)
每日一次午夜
EXEC sp_add_schedule
@schedule_name = N'UTC +3h Daily Once Midnight' ,
@freq_type = 4,
@freq_interval = 1,
@freq_subday_type = 1 ,
@freq_subday_interval = 0,
@active_start_time=210000
GO
每週一次週日午夜
EXEC sp_add_schedule
@schedule_name = N'UTC +6h Weekly Once Sunday Midnight' ,
@freq_type = 8,
@freq_interval = 1,
@freq_subday_type = 1 ,
@freq_subday_interval = 0,
@active_start_time=180000
GO
你們是不是隻在星期日運行作業每週 – TheGameiswar
是的,我@TheGameiswar –
我沒有看到你的第二個計劃的任何問題,MSDN指定了相同的.. @ freq_type = 8, @freq_interval = 1,意味着每週只有星期天 – TheGameiswar