- Job_Name: This is job’s registered name on the server’s instance.
- Last_Executed_Step_ID: This is the ID of the last executed step in the job. E.g. if a job has 4 steps, and currently it is running 3rd step, so last executed step will be 2 and it will be populated with 2 against Job’s 2nd step row, while all other steps rows will have 0.
- Step_ID: This query returns all steps included in the job along with their id, while 2nd column, returns id same as in this column.
- Step_Name: This reflects job step name that was given during job creation.
- Start_Execution_Date: This column returns execution date and time of this job. So you can get an idea when this started execution.
LTRIM(RTRIM(CONVERT(VARCHAR(100),j.name))) job_name
FROM msdb.dbo.sysjobs j WITH (NOLOCK)
WHERE j.enabled=1
ORDER BY 1,3