Find text in Stored Procedures & then find JOB associate with Stored Procedure in SQL Server

Spread the love


Few days before I was asked to disable some ‘JOB’ in a production SQL Server. But the task was a little tricky!! I was given a subject line and asked to stop that particular daily auto report email. Server IP & Database name was only provided. Now the challenge was to find that stored procedure where that SUBJECT LINE was used & the JOB by which that particular stored procedure is executing.

Script to find TEXT in the Stored Procedure

First, we google & found two suitable SQL script to find TEXT in the stored procedure within a database.

Script to find JOB associate with Stored Procedure

So we found the stored procedure name finally. Now we need to find the associated JOB, by which the stored procedure execution took place & disable that JOB.

Below script can be used to find ‘Job’ by providing stored procedure name


Spread the love
Author: OTi
Meet OTi, the brains behind the popular tech blog "" OTi is an accomplished author, tech enthusiast, and an expert in SQL Server. With over a decade of experience in the tech industry, he has become a trusted voice in the world of database management. OTi's passion for technology began at a young age, and he has been tinkering with computers ever since. He graduated with a degree in Computer Science and has since worked for some of the biggest tech companies in the world. His experience has given him a deep understanding of how technology works and how it can be used to improve our lives.

Leave a Reply

Your email address will not be published. Required fields are marked *