How to find all jobs that call a stored procedure.

I need to find all SQL Agent jobs that call a certain stored procedure. You could open every Agent job and inspect each step or you could do it the smart way and use a query! You can also use this method to find other items (tables, views, functions, etc.)

Read more: How to find all jobs that call a stored procedure.

I need to find any job that is using a stored procedure. Using this query below, I just need to modify the WHERE clause for what I am searching for. Also make sure you change the database to MSDB.

use msdb
GO
SELECT Job.name AS JobName,
Job.enabled AS ActiveStatus,
JobStep.step_name AS JobStepName,
JobStep.command AS JobCommand
FROM sysjobs Job
INNER JOIN sysjobsteps JobStep
ON Job.job_id = JobStep.job_id
WHERE JobStep.command LIKE '%spBHTamper%'

The results show two different Jobs that have spBHTamper in it.

I open up the Tamper Export job, and I see that indeed the spBHTTamperExport is being called. Success!

To read more about the MSDB database, please visit this link: https://learn.microsoft.com/en-us/sql/relational-databases/databases/msdb-database?view=sql-server-ver16