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 |
Do you know spatial data types - geometry and geography in sql server 2008?
what are the new features introduced in sql server 2000? : Sql server database administration
What is the difference between seek predicate and predicate?
Explain go command in sql server?
What command is used to delete a table from the database in the sql server and how?
Explain what is cte (common table expression)?
How can we improve performance by using SQL Server profiler?
How to sort the query output with order by clauses in ms sql server?
How to test subquery results with the exists operator?
Which TCP/IP port does SQL Server run on?
What is coalesce and check constraint in sql server?
Explain user defined views?