2013-09-25 191 views
0

我在SQL Server中设置了一个名为“撤消更新”的作业。这是SQL Server代理每45分钟运行的一项工作。是否有SELECT语句或我可以执行的系统存储过程来确定作业当前正在运行还是空闲?确定作业是否正在运行

回答

2

我认为您可以使用sp_help_job来查看服务器上的作业状态。你可以看到更多的信息here

从我的SQL帮助,尝试搜索...

EXEC dbo.sp_help_job @Job_name = 'Retreat Update' 

enter image description here

+0

这个工作。其中一个返回的字段是'current_execution_status'。 MSDN不会告诉你数字的含义。对于任何感兴趣的人,这里是[描述返回号码的链接](http://ranjithk.com/2010/04/23/dynamically-getting-the-execution-status-of-a-sql-server-agent-工作/) – Icemanind

+0

@icemanind,我发布的链接上面有一个表到'@ execution_status' – christiandev

+0

谢谢@christiandev – Icemanind

相关问题