创建表描述
EXEC sp_addextendedproperty @name = 'MS_Description', @value = '你的列描述', @level0type = 'SCHEMA', @level0name = '你的schema', @level1type = 'TABLE', @level1name = '你的表名', @level2type = 'COLUMN', @level2name = '你的列名';
查询表描述
SELECTc.name as '列名',ISNULL(p.value, '') as '描述'
FROMsys.columns cLEFT JOINsys.extended_properties p ON c.object_id = p.major_id AND c.column_id = p.minor_id
WHEREc.object_id = OBJECT_ID('dbo.files') -- 替换为你的表名和schema
ORDER BYc.column_id;