Subscribe

SQLServer-DBA.com Links

Subscribe to newsletter

Dba_db2_button

Powered by TypePad
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
go
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)

******** *******

Subscribe to SQLServer-DBA.com

Latest posts delivered to you daily

Delivered by FeedBurner

Verify your Comment

Previewing your Comment

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

Working...
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.

Working...

Post a comment


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