Google search bar

August 12, 2014

Is my SQL Server Agent Job already running?

I'm writing a little .NET application that watches for an event in a SQL server in one domain and starts an SQL Server Agent job on a SQL Server in another domain.  Here is how I determined if the job were already running:
exec dbo.sp_help_job
@job_name = 'TheJobName',
@job_aspect = 'JOB',
@execution_status = 1
If this returns any rows, the named job is running.