Created
July 2, 2014 12:51
-
-
Save kdarty/e9460e23f2796207a504 to your computer and use it in GitHub Desktop.
Search all SQL Server Modules (Procedures, etc) for given Search Term
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
| -- Search all SQL Modules (Procedures, etc) for given Search Term | |
| DECLARE @Search varchar(255) | |
| SET @Search='what I am looking for' | |
| 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment