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 |
What is sql server query analyzer?
How much is a sql server license?
What does it mean if @@cursor_row returns a negative number?
what are the different ways of moving data/databases between servers and databases in sql server? : Sql server database administration
What is the difference between index seek vs. Index scan?
how to know Who Is Blocking Your SQL Server?
How can I create a table from another table without copying any values from the old table?
How to create a testing table with test data in ms sql server?
What is Cross Join
Explain the xml support sql server extends?
is it possible to use a variable in a query with the IN clause (a,b,c..z), without getting quotes or conversion errors?
How do I start sql server?
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)