What does it mean to have jobs with a null stop date?

I had used the following SQL to list out all jobs without a stop date. I thought that I could use this to find all active jobs. What I noticed is that I have a number of jobs in this table with a null stop_execution_date. Some identical jobs (same job_id) are repeated multiple times in this table.

select job.*, activity.*
from msdb.dbo.sysjobs_view job
inner join msdb.dbo.sysjobactivity activity
on (job.job_id = activity.job_id)
where run_Requested_date is not null and stop_execution_date is null

When I run EXEC msdb.dbo.sp_help_job on these jobs, I see that they the current execution status is idle.

  • Is inserting a new database entry faster than checking if the entry exists first?
  • SQL Query to find the most recent group of records
  • How to make a passthrough / passthru query editable?
  • Selecting Persons in table and exclude wife but combine their names
  • `0` values are not shown when I put a string value filter SQL
  • Easy way for Crystal Reports to MS SQL Server Reporting Services conversion
  • What do these jobs represent? Is this the behavior when the jobs are not killed properly?

    One Solution collect form web for “What does it mean to have jobs with a null stop date?”

    Each time the SQL Agent starts, it puts a new row in syssessions and subsequently any jobs run will get that session_id in sysjobactivity. For your jobs that have a null stop date, my guess is that they’re not for the “current” session which would mean that they were still running when the agent was stopped.

    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.