监控SQL Server的job执行情况

在服务器没有设置发邮件并且不允许发邮件的情况下, 可以通过下列语句来检查SQL Server 的job的执行情况

select top 150 a.run_date,a.run_time, b.name,step_id,step_name,a.message,a.run_status,a.run_duration
from msdb.dbo.sysjobhistory a ,msdb.dbo.sysjobs b
where a.job_id=b.job_id and name not in('job_exclude') and a.step_id>0
order by run_date desc

参考网址:

http://ladymaidu.iteye.com/blog/1246253

原文地址:https://www.cnblogs.com/micolour/p/3259251.html