Skip to content

Instantly share code, notes, and snippets.

@ghotz
Created May 16, 2024 14:21
Show Gist options
  • Save ghotz/f74487c15c525f8b6904f3e86094753a to your computer and use it in GitHub Desktop.
Save ghotz/f74487c15c525f8b6904f3e86094753a to your computer and use it in GitHub Desktop.
Search in SQL Agent job steps commands
SELECT
JO.[name] AS job_name, JO.[enabled]
, JS.step_id, JS.step_name, JS.subsystem, JS.command
FROM msdb.dbo.sysjobs AS JO
JOIN msdb.dbo.sysjobsteps as JS
ON JO.job_id = JS.job_id
WHERE JS.command like N'%something%'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment