Dan Dan - 1 year ago 83
SQL Question

Sql to query a dbs scheme

In SqlServer. How do you query a db to bring back all the tables that have a field of a specific name?

Answer Source

The following query will bring back a unique list of tables where Column_Name is equal to the column you are looking for:

SELECT Table_Name
WHERE Column_Name = 'Desired_Column_Name'
GROUP BY Table_Name
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download