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.
| Author |
Topic |
|
sross81
Posting Yak Master
228 Posts |
Posted - 2008-10-07 : 15:57:34
|
| Hello,I have 2,573 tables and I want to know out of all of these tables which ones contain a field called person_id. Is this something that is possible? I can't even think of where to start with the select statement. Any ideas would be greatly appreciated. Thanks in Advance!Sherri |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-10-07 : 16:00:02
|
| See this:http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
sross81
Posting Yak Master
228 Posts |
Posted - 2008-10-07 : 16:26:20
|
Wow the information schema is really helpful! I had never had to use that before but I was able to link a few of those views together and get exactly what I needed. Thanks for your help.quote: Originally posted by tkizer I wouldn't bother with the link that sodeep posted when you can do this easily like this:SELECT TABLE_NAMEFROM INFORMATION_SCHEMA.COLUMNSWHERE COLUMN_NAME = 'person_id'Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog
Thanks in Advance!Sherri |
 |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
|
|
|
|
|