select c.name as '列名', case when c.is_identity = 1 then '√' else '×' end as '自增', ty.name as '数据类型', c.max_length as '长度', case when c.is_nullable=1 then '√' else '×' end as '允许null', isnull(e.value,'') as '说名' from sys.tables as t join sys.all_columns as c on t.object_id=c.object_id left join sys.extended_properties as e on e.major_id=c.object_id and e.minor_id=c.column_id join sys.types as ty on ty.user_type_id=c.user_type_id where t.name='calss' and SCHEMA_NAME(t.schema_id)='school'
标签:object,join,name,ty,SQL,Server,sys,表名,id From: https://www.cnblogs.com/sunyunsheng/p/17664269.html