Query Thru jobs

Leo Torres
Leo Torres used Ask the Experts™
on

Is there any way for me to query the text inside the command steps of a job. I would like to look for strings there

I am trying to do something like this

Select * from some JobTable
where someColumn like '%exec myStoreProc%'

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Yes, in fact the query you posted will work without a problem. If you need more specifics, post more information, especially about the jobs you have in mind - what is it? or do you mean SQL Server Agent jobs?
If you are trying to query your SQL jobs, you can use something like this.

Greg

SELECT  
      *
FROM  
      msdb..sysjobs a INNER JOIN
      msdb..sysjobsteps b ON a.job_id = b.job_id
WHERE
      b.command LIKE '%exec myStoreProc%'

Author

Commented:
DAM

that was fast worked like a charm :)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial