SELECT @@SERVERNAME AS server_name, sjs.last_run_outcome,sj.enabled, sj.name, sjs.step_id, sjs.step_name, sjs.database_name, CAST(CAST(sjs.last_run_date AS varchar(10)) AS datetime) AS failed_date
FROM msdb.dbo.sysjobsteps AS sjs INNER JOIN
msdb.dbo.sysjobs AS sj ON sjs.job_id = sj.job_id
WHERE (sjs.last_run_date <> 0) AND (CAST(CAST(sjs.last_run_date AS varchar(10)) AS datetime) > GETDATE() – 2)
ORDER BY sj.name
Precious Lite 2022 | All Rights Reserved. Precious Lite theme by Flythemes