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 the steps you will take to improve the performance of a poor performing query?
How to use group functions in the select clause in ms sql server?
What is an inner join?
you notice that the transaction log on one of your databases is over 4gb the size of the data file is 2mb what could cause this situation, and how can you fix it? : Sql server administration
what is a major difference between sql server 6.5 and 7.0 platform wise? : Sql server database administration
Indexes are updated automatically is the full-text index also updated automatically?
What is the order by used for?
How can I track the changes or identify the latest insert-update-delete from a table?
What is xdr?
How can I check if a view exists in a sql server database?
What are the approximate numeric data types?
Can a cursor be updated? If yes, how you can protect which columns are updated?
How can you set the threshold at which sql server will generate keysets asynchronously?
how can you check the level of fragmentation on a table? : Sql server administration
What is the difference between lock, block and deadlock? : sql server database administration