首页 > 代码库 > 查看表中字段名称和说明

查看表中字段名称和说明

SELECT c.name 字段名称,t.name 类型,t.max_length 长度,e.[value] 说明
FROM sys.objects o
INNER JOIN sys.[columns] c ON c.[object_id] = o.[object_id]
INNER JOIN sys.types T ON C.user_type_id=T.user_type_id
INNER JOIN sys.extended_properties e ON c.[object_id]=e.major_id AND c.column_id=e.minor_id
WHERE o.name=‘表名‘ AND e.class=1

 

查看表中字段名称和说明