SELECT (case when a.colorder=1 then d.name else '' end) 表名,
a.colorder 字段序号,a.name 字段名,g.[value] AS 字段说明 FROM syscolumns a left join systypes b
on a.xtype=b.xusertype inner join sysobjects d on a.id=d.id and d.xtype='U' and d.name<>'dtproperties'
left join sys.extended_properties g on a.id=g.major_id AND a.colid = g.minor_id
WHERE d.[name] ='table'
and a.colorder not in (' + notin +')
a.colorder 字段序号,a.name 字段名,g.[value] AS 字段说明 FROM syscolumns a left join systypes b
on a.xtype=b.xusertype inner join sysobjects d on a.id=d.id and d.xtype='U' and d.name<>'dtproperties'
left join sys.extended_properties g on a.id=g.major_id AND a.colid = g.minor_id
WHERE d.[name] ='table'
and a.colorder not in (' + notin +')
order by a.id,a.colorder
本文转自鹅倌51CTO博客,原文链接:http://blog.51cto.com/kaixinbuliao/1941846 ,如需转载请自行联系原作者