user6576015
user6576015

Reputation: 45

SQL Server 2008 - SELECT query

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

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1269623

Use INFORMATION_SCHEMA.COLUMNS:

select c.*
from INFORMATION_SCHEMA.COLUMNS c
where column_name = 'EmployeeID';

Upvotes: 1

Related Questions