Last active
October 9, 2015 03:48
-
-
Save alexvy86/3433279 to your computer and use it in GitHub Desktop.
Look for DB objects with some text in them
This file contains 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 @textToLookFor VARCHAR(200) | |
SET @textToLookFor = 'InventoryTransaction' | |
SELECT * FROM INFORMATION_SCHEMA.ROUTINES | |
WHERE OBJECT_DEFINITION(OBJECT_ID(ROUTINE_SCHEMA + '.' + ROUTINE_NAME)) LIKE '%' + @textToLookFor + '%' | |
SELECT * FROM INFORMATION_SCHEMA.TABLES | |
WHERE OBJECT_DEFINITION(OBJECT_ID(TABLE_SCHEMA + '.' + TABLE_NAME)) LIKE '%' + @textToLookFor + '%' | |
SELECT * FROM INFORMATION_SCHEMA.VIEWS | |
WHERE OBJECT_DEFINITION(OBJECT_ID(TABLE_SCHEMA + '.' + TABLE_NAME)) LIKE '%' + @textToLookFor + '%' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment