CoderJony

How to find Stored Procedures containing specific text in SQL Server?

Below small query will list all the procedures that contains specific text.

SELECT OBJECT_NAME(object_id), definition
FROM sys.sql_modules 
WHERE OBJECTPROPERTY(object_id, 'IsProcedure') = 1
AND definition LIKE '%SearchText%'
Buy Me A Coffee