Sql Server根据表名获得所有列及其属性

select a.name columnname,c.name as typename,case when a.is_nullable =then 'Not Nullelse 'Nullend as nullable,a.*
from sys.columns a , sys.objects b, sys.types c 
where a.object_id= b.object_id and b.name='表名and a.system_type_id=c.system_type_id order by a.column_id

posted @ 2014-05-30 14:28  erictanghu  阅读(179)  评论(0编辑  收藏  举报