I\'m in SQL 2008/R2. I want to run a query to see if there is a SQL Agent job calling a specified stored proc (there are too many to inspect manually).
There's alternative to find all procedures called by all jobs inside a specific instance:
SELECT jss.jobname, jss.step_name, p.name FROM sys.procedures p
CROSS apply
(
SELECT j.name AS jobname, js.step_name FROM msdb.dbo.sysjobsteps js
INNER JOIN msdb.dbo.sysjobs j ON js.job_id=j.job_id
WHERE js.command LIKE '%'+p.name+'%'
) jss