i want table name basis on column name.
Answers were Sorted based on User's Feedback
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 |
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 |
Answer / debasis
yes . it's possible
create table emp10(emp10 varchar(20))
| Is This Answer Correct ? | 5 Yes | 3 No |
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 |
Answer / guruswamy
no,columnname and tablename not same to assign
| Is This Answer Correct ? | 0 Yes | 6 No |
A user is a member of the public role and the sales role. The public role has select permission on all the tables. The sales role does not have select permission on some of the tables will the user be able to select from all tables?
ehat is the default port no of sql 2000?
How to drop existing indexes in ms sql server?
Explain about thread and memory management process of SQL?
What is the usage of the sign function?
What do you mean by an execution plan? Why is it used?
Tell me about pre-defined functions of sql?
how to select a field with firstletter as capital and remaining are small letters
What is scan table/view and seek table/view when its occurs? : sql server database administration
what is a traditional network library for sql servers? : Sql server database administration
What is an expensive query?
i want to create procedure for create table in sql server 2005 for example create procedure create_table @table varchar(20) as create @table( id int, name char(20) ) but it will get error what is solution?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)