Select o.object_id, '[' + s.name + '].[' + o.name + ']' as dbname,
case when type = 'V' then 'View' when type = 'U' then 'Table' end as tablename,
cast(p.value as varchar(4000)) as MS_Description
from sys.objects o
left outer join sys.schemas s on s.schema_id = o.schema_id
left outer join sys.extended_properties p on p.major_id = o.object_id and minor_id = 0 and p.name = 'MS_Description'
where type in ('U', 'V')
order by type, s.name, o.name
댓글을 달아 주세요