sql server - how to know status of currently running jobs -
i need know if given job running on ms sql 2008 server. not invoke same job again may lead concurrency issues.
it looks can use msdb.dbo.sysjobactivity
, checking record non-null start_execution_date , null stop_execution_date, meaning job started, has not yet completed.
this give running jobs:
select sj.name , sja.* msdb.dbo.sysjobactivity sja inner join msdb.dbo.sysjobs sj on sja.job_id = sj.job_id sja.start_execution_date not null , sja.stop_execution_date null
Comments
Post a Comment