SQL Server 查询表的字段对应描述、数据类型、长度

create procedure proc_view_cloumns
(
@tableName nvarchar(50)
)
AS
select b.name,a.value,c.name, b.max_length from sys.extended_properties a, sys.columns b,sys.types c where a.major_id = OBJECT_ID(@tableName) and a.major_id = b.object_id and a.minor_id = b.column_id and b.system_type_id = c.system_type_id;
原文地址:https://www.cnblogs.com/changyou7/p/7791730.html