Wednesday, June 22, 2016

Failed Jobs

SELECT a. name, b.step_name, b.message, b.run_date, b.run_time, b.run_duration
FROM msdb.dbo.sysjobs a
INNER JOIN msdb.dbo.sysjobhistory b
ON a.job_id = b.job_id
WHERE b.message like '%The step failed.%'
ORDER BY b.run_date DESC

No comments:

Post a Comment