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 |
How to verify a user name with sqlcmd tool?
How can I get data from a database on another server?
Explain the purpose of indexes?
What is ms sql server service broker?
What is an etl file?
i have account table which consists of account name,card no and card no consists 16 digits now i want to retrieve the data if card no starts from 4 then it should print visa and if it starts from 5 then it should print master so plse help me to write simple query with out store procs .
What are the character string functions supported by sql server 2005?
Explain different types of BACKUPs avaialabe in SQL Server? Given a particular scenario, how would you go about choosing a backup plan?
What is standby servers? Explain types of standby servers.
What is meant by indexing?
How many types of database relationship in sql server?
How many types of Cursor in 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)