SELECT sj.name,
sja.run_requested_date,
DATEDIFF(SECOND, sja.start_execution_date, getdate()) as Duration
FROM msdb.dbo.sysjobactivity sja
INNER JOIN msdb.dbo.sysjobs sj ON sja.job_id = sj.job_id
WHERE (sja.start_execution_date IS NOT NULL AND sja.stop_execution_date IS NULL) -- Running jobs
ORDER BY sja.run_requested_date desc;
sja.run_requested_date,
DATEDIFF(SECOND, sja.start_execution_date, getdate()) as Duration
FROM msdb.dbo.sysjobactivity sja
INNER JOIN msdb.dbo.sysjobs sj ON sja.job_id = sj.job_id
WHERE (sja.start_execution_date IS NOT NULL AND sja.stop_execution_date IS NULL) -- Running jobs
ORDER BY sja.run_requested_date desc;
No comments:
Post a Comment