how to check how many "car" column available in my database

what should the query should I run in order to check how many car column available in my database and belongs to which table?
motioneyeAsked:
Who is Participating?
 
Alex342Connect With a Mentor Commented:
SELECT TABLE_NAME, 'username', COLUMNPROPERTY(OBJECT_ID(TABLE_SCHEMA + '.' + TABLE_NAME), COLUMN_NAME, 'ColumnID') AS COLUMN_ID
FROM host.INFORMATION_SCHEMA.COLUMNS


just rename username to car or what you need.
and rename host to name of db.
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
select TABLE_NAME
from information_Schema.Columns
where Column_Name = 'Car'
0
 
Aneesh RetnakaranConnect With a Mentor Database AdministratorCommented:
In order to eliminate views add this line in the where part "OBJECTPROPERTY(OBJECT_ID(Table_Schema+'.'+Table_Name),'ISTable' )  = 1  "
select TABLE_NAME
from information_Schema.Columns
where Column_Name = 'Car'
AND OBJECTPROPERTY(OBJECT_ID(Table_Schema+'.'+Table_Name),'ISTable' )  = 1
0
 
imitchieConnect With a Mentor Commented:
select TABLE_SCHEMA, TABLE_NAME, DATA_TYPE
from information_schema.columns
where column_name = 'Car'
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.