Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How can we find which table has this field?

Author  Topic 

nilaavu
Starting Member

18 Posts

Posted - 2006-03-20 : 17:00:07

I have a database with over 300 tables. I need to find out which table has this field X . (btw I have many fields to find out)
Is there a query I can do to get this? Or do I have to open each table to do that?


thx

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-03-20 : 17:01:50
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = 'fieldX'

Tara Kizer
aka tduggan
Go to Top of Page

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-03-20 : 20:08:31
nilaavu,

You can use Object Search (F4) in Query Analyzer as well
Go to Top of Page
   

- Advertisement -