| 
	
 | 
 Posted by Dan Guzman on 07/11/06 14:45 
> How can I do it? 
 
One method is to query the INFORMATION_SCHEMA views: 
 
SELECT 
    c.TABLE_SCHEMA, 
    c.TABLE_NAME 
FROM INFORMATION_SCHEMA.TABLES t 
JOIN INFORMATION_SCHEMA.COLUMNS c ON 
    t.TABLE_SCHEMA = c.TABLE_SCHEMA AND 
    t.TABLE_NAME = c.TABLE_NAME 
WHERE 
    t.TABLE_TYPE = 'BASE TABLE' AND 
    c.COLUMN_NAME = 'column order_date' 
ORDER BY 
    c.TABLE_SCHEMA, 
    c.TABLE_NAME 
 
--  
Hope this helps. 
 
Dan Guzman 
SQL Server MVP 
 
"Sashi" <smalladi@gmail.com> wrote in message  
news:1152627046.364476.199010@h48g2000cwc.googlegroups.com... 
> All, is there a way of getting all table names that contain a column 
> name? 
> I'm looking at a DB that has 125+ tables and I'm interested in finding 
> all table names that contain the column order_date. 
> How can I do it? 
> TIA, 
> Sashi 
>
 
  
Navigation:
[Reply to this message] 
 |