Created
June 20, 2020 17:57
-
-
Save Jalalx/11937af10e09b95842737a10ba25454c to your computer and use it in GitHub Desktop.
Search in object definitions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @SearchText varchar(100) = '%search-text%'; | |
SELECT sm.object_id, OBJECT_NAME(sm.object_id) AS object_name, o.type, o.type_desc, sm.definition | |
FROM sys.sql_modules AS sm | |
JOIN sys.objects AS o ON sm.object_id = o.object_id | |
where sm.definition like @SearchText collate SQL_Latin1_General_CP1_CI_AS | |
ORDER BY o.type; | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment