View Single Post
TheMentat TheMentat is offline
Registered
 
TheMentat's Avatar
 
Join Date: Dec 2004
Location: Ocean Park, BC
Posts: 2,451
Garage
Try this:

select c.name as ColumnName
, o.name as TableName
, count(cc.name) as NumCols
from
sysobjects o
join syscolumns c
on c.id = o.id
and o.xtype = 'U'
left join syscolumns cc
on c.name = cc.name
join sysobjects co
on cc.id = co.id
and co.xtype = 'U'
group by c.name, o.name
order by NumCols desc, ColumnName, TableName



ignore all of the columns that have NumCols = 1
__________________
Silver '88 RoW Carrera
Grey '06 A4 Avant
Old 03-28-2008, 12:09 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #10 (permalink)