* You are viewing Posts Tagged ‘SQL Server 2013’

List out jobs and last run times on SQL 2013

Generate a table of jobs and their last run times on SQL Server 2013.

use msdb
;WITH jobhistory as (
SELECT job_id,
run_status,
last_run_time = max(dbo.agent_datetime(run_date, run_time))
FROM msdb.dbo.sysjobhistory
WHERE step_id = 0
AND run_status = 1
GROUP BY job_id, run_status)

SELECT … Continue Reading