i want table name basis on column name.

Answers were Sorted based on User's Feedback



i want table name basis on column name...

Answer / 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

i want table name basis on column name...

Answer / saravanan p

Please find the below query in which, the tables are
selected depends the column name empNo.

select table_name from information_schema.columns where
column_name='empNo'

Is This Answer Correct ?    5 Yes 1 No

i want table name basis on column name...

Answer / debasis

yes . it's possible
create table emp10(emp10 varchar(20))

Is This Answer Correct ?    5 Yes 3 No

i want table name basis on column name...

Answer / gowthami radhakrishnan

yes.we can have a column name in the table name.
create table order
(
order varchar(10),
number int
)

Is This Answer Correct ?    2 Yes 2 No

i want table name basis on column name...

Answer / guruswamy

no,columnname and tablename not same to assign

Is This Answer Correct ?    0 Yes 6 No

Post New Answer

More SQL Server Interview Questions

How to delete duplicate records from a table?(for suppose in a table we have 1000 Records in that we have 200 duplicate Records , so ,how to findout that duplicate Records , how to delete those Records and arranged into sequence order? one more thing that there is no primary key at all)

5 Answers   Infosys, McAfee,


I applied Transactional with updatable subscriptions replication on 2 tables now i want to delete those 2 tables but i cannot delete those tables as replication is running how can i stop replication for those 2 tables(but i don't want to delete those replicated tables but i need to stop the replication) how can i do that

0 Answers  


Can you explain different types of locks in sql server?

0 Answers  


How to filter out duplications in the returning rows in ms sql server?

0 Answers  


What is the process of indexing?

0 Answers  






What are the steps to insert a table?

0 Answers  


What is the default isolation level of the sql server database?

1 Answers   Ness Technologies,


What is the use of keyword with encryption.

0 Answers  


Which databases are part of SQL server default installation? Explain the usage of each?

2 Answers   Accenture,


Can you roll back the ddl statement in a trigger?

0 Answers  


How can you see what type of locks used?

1 Answers  


What are the advantages of paper records?

0 Answers  


Categories