Solved

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

Posted on 2007-11-28
4
235 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 250 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 150 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 100 total points
ID: 20371770
select TABLE_SCHEMA, TABLE_NAME, DATA_TYPE
from information_schema.columns
where column_name = 'Car'
0

Featured Post

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
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…

687 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