Query to search database for Column Name in tables

Query to search database for Column Name in tables

Use YourDatabase

SELECT t.name AS table_name,
SCHEMA_NAME(schema_id) AS schema_name,
c.name AS column_name
FROM sys.tables AS t
INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID
WHERE c.name LIKE '%MyColumn%'
ORDER BY schema_name, table_name;
    • Related Articles

    • Attach mdf file without ldf file in Database

      SQL SERVER – Unable to Attach Database – File Activation Failure – The Log Cannot be Rebuilt Error: An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) Could not open new database 'MyLostDB'. ...