Reprinted from: http://www.maomao365.com/?p=4983
<span style="color:red;font-weight:bold;">The
following description - use sql script to obtain the description information corresponding to all columns in the specified table, the
script is as follows:
</span>
SELECT ( case when a.colorder = 1 then d.name else '' end ) [ datatable name ] , a.colorder [ column order ] , a.name [ column name ] , b.name as [ column type ] , b.length as [ column length ] , 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 ] = ' IError ' -- data table name order by a.id, a.colorder