如题
------解决方案--------------------
SELECT
字段名 = a.name,
类型 = b.name,
字段说明 = isnull(g.[value], ' ')
FROM
syscolumns a
left join
systypes b
on
a.xusertype=b.xusertype
left join
sysproperties g
on
a.id=g.id and a.colid=g.smallid
where
a.id=object_id( '要查询的表 ') --如果只查询指定表,加上此条件
order by
a.id,a.colorder
------解决方案--------------------
SELECT
字段名=a.Name,
类型=B.Name,
长度=COLUMNPROPERTY(a.ID,a.Name, 'PRECISION '),
字段说明=IsNull(G.[value], ' ')
FROM syscolumns a
left join systypes B On a.Xtype=B.xusertype
left join sysproperties G On a.ID=G.ID And a.colid=G.smallid
Where a.id=object_id( '要查询的表 ') --如果只查询指定表,加上此条件
order by a.ID,a.colorder