获取SQL server 中的表和说明
时间:2021-07-01 10:21:17
帮助过:6人阅读
SELECT 表名 = case when a.colorder = 1 then d.name
else ‘‘ end,
表说明 = case when a.colorder = 1 then isnull(f.value, ‘‘)
else ‘‘ end
FROM syscolumns a
inner join sysobjects d
on a.id = d.id
and d.xtype = ‘U‘
and d.name <> ‘sys.extended_properties‘
left join sys.extended_properties f
on a.id = f.major_id
and f.minor_id = 0
Where (case when a.colorder = 1 then d.name else ‘‘ end) <>‘‘
获取SQL server 中的表和说明
标签: