user1043535
user1043535

Reputation:

In SSMS is there a way to export a list of job steps in a SQL Server Agent job?

In SSMS is there a way to export a list of job steps in a SQL Server Agent job?

The reason I'm asking is that I've been asked to organize a long list of job steps placed in three different jobs. This is something I'd like to share with my team in an Excel document so that we can make notes, demonstrate grouping and sorting ideas, argue about it, etc.

Is there a way I can export this list, or at least print it? I could do a screenshot, except that the list extends past the screen? I'm not looking forward to keying this by hand into Excel.

Thank you for any ideas.

Upvotes: 1

Views: 3587

Answers (1)

Alex K.
Alex K.

Reputation: 175826

You can query the server;

select 
    job.name,
    steps.step_id,
    steps.step_name,
    steps.command
from MSDB.dbo.SysJobs job
    inner join MSDB.dbo.SysJobSteps steps on steps.Job_Id = job.Job_Id
where job.enabled = 1
order by 1, 2

Upvotes: 7

Related Questions