select a.name 列名,isnull(cast(c.value as varchar(8000)), ' ') 描述 from syscolumns a
left join sysproperties c on a.id = c.id and a.colid=c.smallid
where a.id=object_id( 'Lokeover_B')
或建一视图
create view xx
as
SELECT *
FROM ::FN_LISTEXTENDEDPROPERTY( 'Ms_Description ', 'User ', 'dbo ', 'table ', 'Bridge ', 'COLUMN ',DEFAULT)
以下为查看所有扩展属性
CREATE table T1 (id int , name char (20)) EXEC sp_addextendedproperty 'caption', 'Employee ID', 'user', dbo, 'table', 'T1', 'column', id EXEC sp_addextendedproperty 'caption', 'Employee Name', 'user', dbo, 'table', 'T1', 'column', name SELECT * FROM ::fn_listextendedproperty (NULL, 'user', 'dbo', 'table', 'T1', 'column', default)