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
 find same coumn in other tables

Author  Topic 

allan8964
Posting Yak Master

249 Posts

Posted - 2008-06-09 : 16:45:44
Is there any way i can find some certain fields in the whole database? like i know a column called Type_ID in table Sys_Type, how can i know there are same Type_ID column in other tables? Thanks in advance.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-09 : 17:05:27
SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME IN ('Type_ID', 'Sys_Type')

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

allan8964
Posting Yak Master

249 Posts

Posted - 2008-06-09 : 18:49:06
I got it, thank you so much!!!
Go to Top of Page
   

- Advertisement -