sql2005 sql 2008下得到表中列的类型和说明
SELECT o.name as table_name,c.name AS col_name,TYPE_NAME(c.user_type_id) AS type_name,isnull(ep.value,'') AS col_Property FROM sys.objects AS o JOIN sys.columns AS c ON o.object_id = c.object_id
LEFT JOIN sys.extended_properties ep ON c.object_id = ep.major_id and c.column_id=ep.minor_id
WHERE o.name = '表名' ORDER BY c.column_id
LEFT JOIN sys.extended_properties ep ON c.object_id = ep.major_id and c.column_id=ep.minor_id
WHERE o.name = '表名' ORDER BY c.column_id