select a.name, b.name + ‘(‘+ convert(varchar,a.length) + ‘)‘ + case a.isnullable when 1 then ‘ Null‘ else ‘‘ end as [type], ‘‘ as Pretty from syscolumns a join systypes b on (a.xusertype = b.xusertype) where a.id = object_id(‘TableName‘) Order By a.ColOrder
得到结果为:
原文地址:http://2311390.blog.51cto.com/2301390/1702449