34,587
社区成员
发帖
与我相关
我的任务
分享
IF ((@freq_subday_type <> 0x1) AND (@freq_subday_interval < 1)) -- FREQSUBTYPE_ONCE and less than 1 interval
OR
((@freq_subday_type = 0x2) AND (@freq_subday_interval < 10)) -- FREQSUBTYPE_SECOND and less than 10 seconds (see MIN_SCHEDULE_GRANULARITY in SqlAgent source code)
BEGIN
SELECT @reason = FORMATMESSAGE(14200, '@freq_subday_interval')
RAISERROR(14278, -1, -1, @reason)
RETURN(1) -- Failure
END
其中定义了小于10秒就报错,我刚才试了,把这个10改成1秒,是可以的,然后再创建作业的时候,就可以改成9秒一次,不过不知道你敢不敢改而已。用图形化界面其实还是调用系统存储过程,所以你一直用sp_helptext '存储过程名'就可以看到它的算法。
另外,10秒有它的道理,一个作业过于频繁地执行,对服务器来说负担很重。应该考虑是否有这个必要。
while 1=1
begin
exec xxxxx
waitfor delay '00:00:01'
end