如何每 1 秒运行一次 SQL 作业?

AnO*_*oul 6 sql-server sql-server-2012 jobs

我有一个 SQL 作业,它在给定时间处理最少的行。目前它每 10 秒运行一次,这是 Job Scheduler 中可用的最小值。但正因为如此,作业处理使用的表会被许多记录填满。所以我需要每 1 秒运行一次作业。怎样才能做到这一点?请指教。

Mus*_*yed 7

创建一个计划每分钟启动的作业。让工作做一些类似的事情:

WHILE 1=1
BEGIN
    EXEC dbo.SomeProcedure; /*  this would be the 
        name of a stored procedure that does the 
        actual work */
    WAITFOR DELAY '00:00:01.000';
END
Run Code Online (Sandbox Code Playgroud)

感谢 Max Vernon,他早些时候给了我这个答案。