Search text in stored procedure in SQL Server

Search text in stored procedure in SQL Server

Try this example to get the list of stored procedure names that are using the ‘text’ you are looking for in SQL Server Stored procedures.

 

Example,

SELECT DISTINCT

               SP.NAME,

               SP.TYPE_DESC

FROM SYS.PROCEDURES AS SP

WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE '%skip%'

                               

/* A different version of query example, To make query more appropriate for different coding practices. I hope it will help you */

SELECT DISTINCT

O.NAME AS OBJECT_NAME,

O.TYPE_DESC

FROM SYS.SQL_MODULES AS M

INNER JOIN SYS.OBJECTS AS O

ON M.OBJECT_ID = O.OBJECT_ID

WHERE UPPER(M.DEFINITION) LIKE UPPER('% skip%');

ANIL SINGH

Anil Singh is an author, tech blogger, and software programmer. Book writing, tech blogging is something do extra and Anil love doing it. For more detail, kindly refer to this link..

My Tech Blog - https://www.code-sample.com/
My Books - Book 1 and Book 2

www.code-sample.com/. Powered by Blogger.
^