SQL Server SQL作业计划:如何跳过某些月份

fykwrbwg  于 2022-12-10  发布在  其他
关注(0)|答案(1)|浏览(143)

I need a report that runs once on the following month below: JAN,FEB,APR,MAY,JUL,AUG,OCT,NOV (essentially skipping MAR, JUN, SEP and DEC)
and this is how I do it (I had to have two schedules to achieve it: See screenshot below). and My question does my two-schedule method will get me what I need? is there a better way? Will this still work in 2024, 2025 and so on?
thanks
The only difference between the schedule is the start date.
THE FIRST Schedule ( I am hoping this report will run on JAN APR JUL OCT)

The second Schedule: ( And the second schedule, I am hoping it will run on FEB MAY AUG NOV)

kcrjzv8t

kcrjzv8t1#

只需每月在t-sql作业步骤中执行一个作业

if month(getdate()) in (1,2,4,5,7,8,10,11)
begin
  exec...
end

相关问题