Sql to query a dbs scheme *

Question

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

Answer

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
From
INFORMATION_SCHEMA.COLUMNS
Where
Column_Name = 'Desired_Column_Name'
Group By
Table_Name
< br > via < a class="StackLink" href=" http://stackoverflow.com/questions/3567/" >Sql to query a dbs scheme< /a>
Share on Google Plus

About Cinema Guy

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment