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 data files?

1091


What is filtered index?

1142


What is master database? : SQL Server Architecture

1081


How to Check if table exists in sql server?

1187


How to use user defined functions in expressions?

1151


Difference between primary key and clustered index?

1061


on line cluster can we make if yes tell me the procedure

2067


what is database replicaion? What are the different types of replication you can set up in sql server? : Sql server database administration

1049


How to find a value in another dataset based on current dataset field (ssrs 2008 r2)?

176


Does table partitioning improve performance?

1015


What is the difference between set and select?

1159


If a table does not have a unique index, can a cursor be opened on it?

959


When you use @@error and try-catch?

1091


What is PROJECTION Operation?

1074


Can you get second highest salary from the table?

1008