Reputation: 45
I have a database with over a 150 tables. I need to be able to find every table that has a column called EmployeeID
. Is there a way for me to find all tables that have this column? It's kind of a long process if I go through each table and try to find if it has that column.
Upvotes: 1
Views: 81
Reputation: 1269623
Use INFORMATION_SCHEMA.COLUMNS
:
select c.*
from INFORMATION_SCHEMA.COLUMNS c
where column_name = 'EmployeeID';
Upvotes: 1