Published on

Find Tables by Column names in SQL Server


Find Tables by column names

While I was working on large legacy SQL server database I always wanted to find the Tables which has some columns. Below is the query I usually used to find the Tables by Column names.

SELECT AS ColumnName, AS TableName
FROM sys.columns c
JOIN sys.tables t ON c.object_id = t.object_id
WHERE LIKE 'column_name';