Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Column Description from System Tables

Status
Not open for further replies.

wandan

Technical User
Dec 16, 2001
101
US
Hello,

I am trying to figure out how to pull object/column info from the system tables. I have figured most of it out, but I cannot figure out how to pull in the Description property for a table column. Thoughts?? Here is what I have so far:

SELECT o.name AS ObjectName, o.id AS ObjectId, c.name AS ColumnName, c.colid AS ColumnSequence, t.name AS ColumnDataType, c.length AS ColumnLength, c.prec AS ColumnPrecision, c.isnullable AS ColumnNullable, c.cdefault AS ColumnDefault
FROM sysobjects o INNER JOIN
syscolumns c ON o.id = c.id INNER JOIN
systypes t ON c.xtype = t.xtype
WHERE (o.name LIKE 'tbl%')
ORDER BY o.name, c.colid

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top