?
Solved

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

Posted on 2007-11-28
4
Medium Priority
?
237 Views
Last Modified: 2008-02-01
what should the query should I run in order to check how many car column available in my database and belongs to which table?
0
Comment
Question by:motioneye
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 20371660
select TABLE_NAME
from information_Schema.Columns
where Column_Name = 'Car'
0
 
LVL 1

Accepted Solution

by:
Alex342 earned 1000 total points
ID: 20371747
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
 
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 600 total points
ID: 20371766
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
 
LVL 25

Assisted Solution

by:imitchie
imitchie earned 400 total points
ID: 20371770
select TABLE_SCHEMA, TABLE_NAME, DATA_TYPE
from information_schema.columns
where column_name = 'Car'
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question