Saturday, October 2, 2021

How to search through Stored procedures in SQL Server

 You can use below query to search through Stored procedures in SQL Server. It will help to find part of string present in stored procedure.


SELECT o.type_desc AS ROUTINE_TYPE,o.[name] AS ROUTINE_NAME,
m.definition AS ROUTINE_DEFINITION
    FROM sys.sql_modules AS m INNER JOIN sys.objects AS o
        ON m.object_id = o.object_id WHERE m.definition LIKE '%RK From SP Modified%'
    order by ROUTINE_NAME


Output:






No comments:

Post a Comment