Check SQL jobs which have run during daylight saving’s change hours.

What has run, during the last month, on Sunday’s between 1:59 AM and 3?
Use the to check on daylight saving’s jobs which might be missed.


SELECT MAX(master_admin.dbo.fn_INTtoDateTime(run_date, run_time) ),
j.name
FROM msdb.dbo.sysjobhistory h WITH (NOLOCK)
JOIN msdb.dbo.sysjobs j WITH (NOLOCK)
ON j.job_id = h.job_id
WHERE datename(dw, convert(varchar(10),run_date, 112) ) = 'Sunday'
AND run_time BETWEEN 015900 AND 030000
AND step_id = 0
AND run_date >= CONVERT(VARCHAR(8), DATEADD(day, -31, GETDATE()), 112)
GROUP BY j.name ,DATENAME(weekday, CONVERT(VARCHAR(10), run_date, 112))
ORDER BY
name

This uses one of my functions. fn_INTtoDateTime

Comments are closed.

Post Navigation