SQL SERVER中查看某个时间段内出错的作业
SQL SERVER中查看某个时间段内出错的作业查询指定日期内出错的作业的SQL语句
SELECT j.name AS JOB_NAME
,j.description AS JOB_Description
,j.date_created AS Date_Created
,j.date_modified AS Date_Modified
FROM msdb.dbo.sysjobs j
WHERE enabled = 1
AND EXISTS (
SELECT 1
FROM Msdb.dbo.sysjobhistory h
WHERE run_status = 0
AND j.job_id = h.job_id
AND run_date between 20160105 and 20160505)