Created
October 25, 2012 22:58
-
-
Save mwinckler/3956001 to your computer and use it in GitHub Desktop.
Find all tables in SQL server having column name
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
-- From http://stackoverflow.com/a/4849704/81554 | |
SELECT c.name AS ColName, t.name AS TableName | |
FROM sys.columns c | |
JOIN sys.tables t ON c.object_id = t.object_id | |
WHERE c.name LIKE '%MyName%' | |
SELECT COLUMN_NAME, TABLE_NAME | |
FROM INFORMATION_SCHEMA.COLUMNS | |
WHERE COLUMN_NAME LIKE '%MyName%' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment