Skip to content

Instantly share code, notes, and snippets.

@t0nydean
Created September 27, 2012 18:53
Show Gist options
  • Save t0nydean/3795719 to your computer and use it in GitHub Desktop.
Save t0nydean/3795719 to your computer and use it in GitHub Desktop.
Search MSDB job and step data for string
SELECT @sql_str = ' SELECT j.name, s.step_id, s.step_name, s.command
FROM MSDB..sysjobsteps s JOIN MSDB..sysjobs j ON s.job_id = j.job_id
WHERE s.command LIKE ''%'+@search_str+'%'''
EXEC (@sql_str)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment