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

Why should we go for stored procedures? Why not direct queries?

1 Answers  


What are different types of collation sensitivity?

1 Answers  


Write a SQL query in order to merge two different columns into single column?

1 Answers   QuestPond,


What is an entity-relationship diagram (erd)?

1 Answers  


What is self join in sql server joins?

1 Answers  


Explain primary key and foreign key constraints?

1 Answers  


What is database normalization?

7 Answers   Deloitte, Digicel, JPMorgan Chase, Verifone,


what is syntex second or third highest salary. thanks & Regards Dhirendra sinha

7 Answers  


What are triggers? How many triggers you can have on a table? How to invoke a trigger on demand?

1 Answers  


can any one post me, how to remove rows in the below table ENO ENAME EDEPT ELOC 3368 BPS BI Adayar 3371 RAN BI valachari 3369 SRI BI valachari 3372 jay BI Chn - - - - - - - -

2 Answers  


What are the five major components of a dbms?

1 Answers  


What are the dmvs?

1 Answers  


Categories