SELECT OBJECT_NAME(OBJECT_ID), definition
FROM sys.sql_modules WHERE definition LIKE '%' + 'TextToFind' + '%'This query will return all the sql objects which has the given text.
This query will return all the sql objects which has the given text.
SELECT OBJECT_NAME(OBJECT_ID), definition
FROM sys.sql_modules WHERE definition LIKE '%' + 'TextToFind' + '%'