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
Detail about query optimizer?
What happens to a statement batch if there is a compilation error?
What methods do you follow to protect from sql injection attack?
Can we insert data into a view?
What are Row versions of DataRow?
Explain how dts is used to extract, transform and consolidate data?
How to divide query output into multiple groups with the group by clause in ms sql server?
What part does database design plays a role in performance of an sql server-based application?
What are the purpose of Normalisation?
what is a join and explain different types of joins? : Sql server database administration
Explain having clause?
What are sql server functions?
How much space does sql server 2016 take?
How to implement one-to-one, one-to-many and many-to-many relationships while designing tables?
how can you attach more than 20 ldf files in sql server