Answer Posted / 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 |
Post New Answer View All Answers
What are data files?
What is filtered index?
What is master database? : SQL Server Architecture
How to Check if table exists in sql server?
How to use user defined functions in expressions?
Difference between primary key and clustered index?
on line cluster can we make if yes tell me the procedure
what is database replicaion? What are the different types of replication you can set up in sql server? : Sql server database administration
How to find a value in another dataset based on current dataset field (ssrs 2008 r2)?
Does table partitioning improve performance?
What is the difference between set and select?
If a table does not have a unique index, can a cursor be opened on it?
When you use @@error and try-catch?
What is PROJECTION Operation?
Can you get second highest salary from the table?