SELECT A.NAME AS 'TABLE_NAME',B.NAME AS 'propvalue',isnull(C.VALUE,B.NAME) AS 'labelvalue',*
FROM SYS.OBJECTS A LEFT JOIN SYS.COLUMNS B ON A.OBJECT_ID=B.OBJECT_ID
LEFT JOIN SYS.EXTENDED_PROPERTIES C ON A.OBJECT_ID=C.MAJOR_ID AND C.minor_id = B.column_id
where A.name='V_WIP_JG_PLAN'
未经允许不得转载:lxfamn » sqlserver 查询表和视图列名和注释