How To Find Text In SQL Server Job Agent Step Using T-SQL



TODO:

Have you ever wanted to find text in a SQL Agent Job or Job Step?

 

SOLUTION:

SELECT	j.job_id,
     s.srvname,
     j.name,
     js.step_id,
     js.command,
     j.enabled 
FROM	dbo.sysjobs j
JOIN	dbo.sysjobsteps js
	ON	js.job_id = j.job_id 
JOIN	master.dbo.sysservers s
	ON	s.srvid = j.originating_server_id
WHERE	js.command LIKE '%Enter Text Here%'

 

NOTES:

There are no notes on this topic.



Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading