Find text in Stored Procedures

Find text in Stored Procedures

I can’t express how useful this has been to me when trying to find whether a text string exists in one of our Stored Procedures / Functions:

DECLARE @value VARCHAR(50) = 'getPrice'
SELECT DISTINCT AS Object_Name, o.type_desc
FROM sys.sql_modules m
INNER JOIN sys.objects o ON m.object_id = o.object_id
WHERE m.definition LIKE '%' + @value + '%'

Australian. Sport. Passionate Cricket Fan. Go Pro. Abseiling. Snorkeling. Travel. Golf R. SQL Server Developer. Three sons. One daughter. Last Trip: New York.

Related Posts
Leave a comment

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