sql2005 和 sql2008 表的 主键 字段 类型 长度 描述
select c.name, t.name,c.max_length,c.precision, isnull(p.value,'') as value
,case when c.is_nullable =1 then 'Y' else 'N' end as is_nullable
,isnull(substring(d.definition,2,len(d.definition)-2),'') as defaultvalue
,ISNULL(k.type,'')as pk
from sys.all_columns c
left join sys.systypes t on c.system_type_id =t.xtype
left join sys.extended_properties p on p.minor_id = c.column_id
left join sys.default_constraints d on c.object_id = d.parent_object_id and d.parent_column_id =c.column_id
left join sys.index_columns i on i.object_id = c.object_id and c.column_id =i.column_id
left join sys.key_constraints k on i.object_id = k.parent_object_id
where c.object_id =object_id('c48111926_1');