SQL Server Agent Job Steps

28 February,2012 by Jack Vamvas

To list a SQL Server Agent Job Steps use the T-SQL example below.

This example displays the step id, SQL Server Agent Job name, Step name.

The code has 1 input parameter - @job_name


use msdb
DECLARE @job_name nvarchar(128)
SET @job_name = 'My SQL Server Agent Job'
SELECT js.step_id ,j.name,js.step_name 
FROM sysjobsteps js 
inner join sysjobs j 
ON js.job_id=j.job_id 
WHERE j.name = @job_name ORDER BY step_id


See Also

SQL Server agent fixed roles

SQL Agent Jobs – Schedule in seconds

Author: Jack Vamvas (http://www.sqlserver-dba.com)


Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.


Post a comment on SQL Server Agent Job Steps

sqlserver-dba.com | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer