Search text in stored procedure in SQL Server

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


It Might Help Your Complex Homework Requires SQL Assignments

 

Example,

SELECT DISTINCT

               SP.NAME,

               SP.TYPE_DESC

FROM SYS.PROCEDURES AS SP

WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE '%skip%'

                               

/* A different version of the query example, To make the 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.
^