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

Differentiate between SQL and ORACLE joins and write their syntax.

1018


Explain system scalar functions?

989


Explain stored procedure?

1034


How do I start sql server?

961


What are the different acid properties?

1048


How to list all login names on the ms sql server?

1125


What do you mean by recursive stored procedure?

937


Explain what is use of dbcc commands?

1039


Tell about MOM Tool(Microsoft Operator Manager)?

1902


What is a matrix in ssrs?

151


What do we need queues in sql service broker?

1054


How do I find the sql server version?

1006


How to call a function from a stored procedure in SQL Server ?

1003


Mention the differences between sql server and mysql.

1001


What is sub-query in sql server? Explain its properties.

1075