sqlserver 查看各Job运行时间

select j.name,h.step_id,h.step_name,max(h.run_duration) run_duration
from msdb..sysjobs j,msdb..sysjobhistory h
where j.job_id = h.job_id
and enabled = 1
and step_id <> 0
and h.run_date >= convert(char(8), dateadd(day, -1, getdate()), 112)
group by j.name,h.step_id,h.step_name
order by run_duration desc

你可能感兴趣的:(转载,Sql,Server(1))