SELECT
"表名" = OBJECT_NAME(c.object_id),
"列名" = c.name,
"描述"= ex.value,
"类型"=t.name,
"长度"=c.max_length
FROM
sys.columns c
LEFT OUTER JOIN
sys.extended_properties ex
ON
ex.major_id = c.object_id
AND ex.minor_id = c.column_id
AND ex.name = 'MS_Description'
left outer join
systypes t
on c.system_type_id=t.xtype
WHERE
OBJECTPROPERTY(c.object_id, 'IsMsShipped')=0
AND OBJECT_NAME(c.object_id) ='C_customer'
"表名" = OBJECT_NAME(c.object_id),
"列名" = c.name,
"描述"= ex.value,
"类型"=t.name,
"长度"=c.max_length
FROM
sys.columns c
LEFT OUTER JOIN
sys.extended_properties ex
ON
ex.major_id = c.object_id
AND ex.minor_id = c.column_id
AND ex.name = 'MS_Description'
left outer join
systypes t
on c.system_type_id=t.xtype
WHERE
OBJECTPROPERTY(c.object_id, 'IsMsShipped')=0
AND OBJECT_NAME(c.object_id) ='C_customer'