Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2007-11-28
4
Medium Priority
?
242 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

618 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