OK, since all I needed for what I'm planning is the table names,
column names, datatypes, and column length (primarily for varchar
fields), here's the query I came up with (based upon Hatton's work):
SELECT SO.Name as TableName, SC.Name as ColumnName,
ST.name AS columnType, SC.length
FROM SYSOBJECTS SO
INNER JOIN SysColumns SC
ON SO.ID = SC.ID
INNER JOIN SysTypes ST
ON SC.xtype = ST.xtype
LEFT OUTER JOIN
(SELECT SI.id, SI.Name as IndexType, SIK.colid
FROM SysIndexes SI
INNER JOIN SysIndexKeys SIK ON
SI.ID = SIK.ID AND
SI.IndID = SIK.IndID) SysIndexLookup ON
SO.ID = SysIndexLookup.ID AND
SC.ColID = SysIndexLookup.ColID
WHERE so.xtype = 'U'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257691
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4