Created
August 27, 2018 17:49
-
-
Save DCCoder90/297723fb9452e6b5800c6ca15d324e7d to your computer and use it in GitHub Desktop.
Query that searches system tables to identify a table that has a specified 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
SELECT c.name AS 'ColumnName' | |
,t.name AS 'TableName' | |
FROM sys.columns c | |
JOIN sys.tables t ON c.object_id = t.object_id | |
WHERE c.name LIKE '%COLUMN NAME%' | |
ORDER BY TableName | |
,ColumnName; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment