Find all tables containing column with specified name


Find a column name anywhere.

- January 14, 2017

Rest of the Story:

In order to find a column name anywhere it is used in a table or view I was able to use the following SQL…

SELECT      COLUMN_NAME AS 'ColumnName'  
            ,TABLE_NAME AS  'TableName'  
FROM        INFORMATION_SCHEMA.COLUMNS  
WHERE       COLUMN_NAME LIKE '%columnnameyouarelookingfor%'  
ORDER BY    TableName  
            ,ColumnName;  
sql