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 extended events?

955


Explain the characteristics of a transaction server for example atomicity, consistency, isolation, durability?

1023


You accidentally delete the msdb database what effect does this have on your existing sql databases, and how do you recover?

938


What is Command line parameters in PLSQL.?

1062


Why do we need normalization?

877


How do you start single user mode in clustered installations?

905


Where to find ntwdblib.dll version 2000.80.194.0?

923


When would you use it?

945


How do I get Report Builder to generate a parameter that can be set by users viewing the report?

139


What is scrollable cursor?

987


List the advantages of using stored procedures?

999


Can you index views?

853


Explain difference between cross join and full outer join?

955


What are system databases into sql server (2005/2008)?

956


Define outer join?

931