Quantcast
Channel: SQL Server Teacher
Viewing all articles
Browse latest Browse all 26

List all the SQL Agent Jobs and its Steps

$
0
0

Hi,

 

Please find the below query to get all the SQL Agent Jobs and its Steps.

 

SELECT J.NAME AS'JOB NAME',

S.STEP_ID AS'STEP',

S.STEP_NAME AS'STEP NAME',

S.COMMAND AS'QUERY',

DATABASE_NAME as'Database'

FROM MSDB.dbo.SysJobs J

INNERJOIN MSDB.dbo.SysJobSteps S ON S.Job_Id = J.Job_Id

where J.enabled= 1

orderby J.NAME,S.STEP_ID

 

 

Regards,

Selvaraj.


Viewing all articles
Browse latest Browse all 26

Trending Articles