Created
January 7, 2014 23:21
-
-
Save dgershman/8308759 to your computer and use it in GitHub Desktop.
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
| SET NOCOUNT ON | |
| DECLARE @tmp TABLE | |
| ( | |
| Id int identity(1,1), | |
| Name nvarchar(255) | |
| ) | |
| INSERT INTO @tmp | |
| SELECT Name | |
| FROM sys.objects | |
| WHERE type = 'SN' | |
| DECLARE @x int | |
| DECLARE @xMax int | |
| DECLARE @syn varchar(255) | |
| SET @x = 1 | |
| SELECT @xMax = MAX(Id) FROM @tmp | |
| WHILE @x < @xMax | |
| BEGIN | |
| SELECT @syn = Name From @tmp WHERE Id = @x | |
| PRINT @syn | |
| PRINT '===' | |
| SELECT Name | |
| FROM sys.procedures | |
| WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE '%' + @syn + '%' | |
| SET @x = @x + 1 | |
| END | |
| SET NOCOUNT OFF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment