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 convert a table data in XML format in sql server?

0 Answers  


what is an extended stored procedure? : Sql server database administration

0 Answers  


What are magic tables in sql server?

0 Answers  


How to declare and use cursor variables?

0 Answers  


What is sql server database?

0 Answers  






What are the new features in sql server 2016?

0 Answers  


code to create procedure for taking databse backup in sql server or i have the query for it but what it's query returns means i want to show on my jsp that the databse backup has been taken on the basis of that return value.does it returns 0 or 1.wat is the code for that

0 Answers   IGT,


What are different types of database indexes?

0 Answers  


What are four major operators that can be used to combine conditions on a where clause?

0 Answers  


What is save transaction and save point?

0 Answers  


Explain the concepts and capabilities of sql server?

0 Answers  


Explain the categories of stored procedure?

0 Answers  


Categories