Skip to content

SQL – This will search any procedure, view, or function for a string.

DECLARE @Search varchar(255)
SET @Search='CITERIA'

 
SELECT DISTINCT
o.name 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 '%'+@Search+'%'
ORDER BY 2,1

 

Published inSQL

Be First to Comment

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.