Wednesday, May 20, 2009

Which SQL Jobs are currently executing

Following script lists currently executing SQL jobs.

select
j.job_id, j.name
from
msdb..sysjobactivity a (NOLOCK)
inner join
msdb..sysjobs j (NOLOCK)
on
j.job_id=a.job_id
where
a.start_execution_date is not null
and
a.job_history_id is null

No comments: