Last active
October 27, 2022 13:32
-
-
Save petesql/662232a7e83440f32432d1c31cf7d391 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- list all sql agent jobs on instance | |
SELECT | |
j.job_id, | |
j.name, j.description, | |
j.enabled, | |
s.step_id, s.step_name, s.database_name, s.subsystem, s.command, | |
j.date_created, j.date_modified, | |
s.on_success_action, s.on_fail_action, s.retry_attempts, s.retry_interval, | |
s.last_run_outcome, s.last_run_duration, s.last_run_date, s.last_run_time | |
FROM msdb.dbo.sysjobs j WITH (NOLOCK) | |
INNER JOIN msdb.dbo.sysjobsteps s WITH (NOLOCK) | |
ON j.job_id = s.job_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a blog post using this script:
July 21, 2022, List All SQL Agent Jobs on a SQL Server Instance