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
 General SQL Server Forums
 New to SQL Server Programming
 Locate the appearance of a specific field

Author  Topic 

skiabox
Posting Yak Master

169 Posts

Posted - 2009-03-26 : 09:58:14
How can I locate the appearance of a specific field(I mean in which tables it appear) in an entire database?
Thank you very much.

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-03-26 : 10:01:40
select table_name from information_schema.columns
where column_name='the_column_name'
order by table_name


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Bill_C
Constraint Violating Yak Guru

299 Posts

Posted - 2009-03-26 : 10:02:37
SELECT * FROM INFORMATION_SCHEMA.COLUMNS
where table_name = 'Spell'
and column_name = 'myCode'

oops - beat me to it.
Go to Top of Page
   

- Advertisement -