RE: TSQL to find all running SQL Agent jobs

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: John Bell (JohnBell_at_discussions.microsoft.com)
Date: 12/01/04


Date: Tue, 30 Nov 2004 23:45:03 -0800

Hi

sp_help_job returns a current_execution_status for the jobs, you can also
pass a @execute_status parameter to sp_help_job a value of 1 is for a
currently executing job. You can see what sp_help_job is doing by looking at
the definition in msdb, if it is sufficient then you can use it as the basis
for your own procedure.

More information on sp_help_job is available on Books online

John

"Hassan" wrote:

> I've looked at sp_help_job but cant really seem to find out current
> execution status . So basically I want to be able to run a TSQL that will
> list all jobs that are currently running
>
>
>