Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

i want table name basis on column name.

Answer Posted / bobby

select * from information_schema.columns where
column_name='orderid'

The above query is used to find all the tables and views in
the Database which contain ‘orderId’ as column name.

But to find only the tables in the Database which
contain ‘orderId’ as column name, use the below query.


select col.table_name from information_schema.columns Col
join information_schema.tables Tab
on col.table_name=tab.table_name and
col.column_name='orderId'and tab.table_type='Base Table'

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are logical database components? : SQL Server Architecture

958


Why is replication required on the sql server?

1004


What purpose does the model database server?

1053


How to reaname table name without using sp_Rename in sql server..?

935


How to use values from other tables in update statements in ms sql server?

1037


How can i Relate Tables in SSIS

1032


plss anybody specify tha constrian management system in dbms

2077


What is the difference between getdate and sysdatetime?

940


What is query parameter in ssrs?

143


How to run sql server 2005 books online on your local system?

914


what is nonclustered index

889


What is the difference between a stored procedure and a user defined function?

970


What is difference between commit and rollback when used in transactions?

901


Describe different Processing Modes offered by SSRS?

232


Mention the different authentication modes in sql server.

955