denrepo

SQL ServerScheduler & jobs

SQL Agent job failures in the last 24 hours

Failed job steps with their error message, newest first. Good for a morning check.

Not yet verified. How scripts are tested

b-mssql-jobs.sql
1SELECT j.name AS job_name, h.step_id, h.step_name,2       msdb.dbo.agent_datetime(h.run_date, h.run_time) AS run_at,3       h.message4FROM msdb.dbo.sysjobhistory h5JOIN msdb.dbo.sysjobs j ON j.job_id = h.job_id6WHERE h.run_status = 07  AND msdb.dbo.agent_datetime(h.run_date, h.run_time) >= DATEADD(HOUR, -24, GETDATE())8ORDER BY run_at DESC;

Paste it into your query tool.

Open in denrepo