Spd Spd - 7 months ago 7
SQL Question

Finding the specific column (field) name from multiple tables in a database

I have large numbers of tables in my database. I am searching for a column named

Country
, but don't know which table contains that column. Is there a specific query that will help me to find the name of the table containing this column?

Answer

Yes, you can use INFORMATION_SCHEMA.COLUMNS

SELECT DISTINCT 
   TABLE_NAME 
FROM 
   INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = 'Country'
Comments