- Jeevan Wijerathna
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 c.name AS ColumnName, t.name AS TableNameFROM sys.columns cJOIN sys.tables t ON c.object_id = t.object_idWHERE c.name LIKE 'column_name';