:::: MENU ::::

Get list of scheduled jobs and associated steps

  • Dec 03 / 2012
  • 0
dbDigger, Monitoring and Analysis, SQL Server Agent scheduled Jobs, T-SQL Scripts

Get list of scheduled jobs and associated steps

I am required to generate a list of SQL Server scheduled jobs along with there associated steps. It would be compared to same list from another server where the jobs just have been transferred. Following code would provide me job names along with their steps

 USE MSDB  
 GO  
 SELECT v.name AS JobName, step_name   
 FROM sysjobs_view v   
 inner join sysjobsteps t ON v.job_id = t.job_id  
 ORDER BY v.name, step_name  
 GO   

We may add further properties of job or step from SYSJOBS_VIEW and SYSJOBSTEPS respectively.

Consult us to explore the Databases. Contact us