select t.name as tablename,c.name as columnname,ty.name as typename,
c.max_length as typelength
from sys.columns c inner join sys.tables t on t.object_id=c.object_id
inner join sys.types ty on ty.system_type_id=c.system_type_id
order by t.name,c.column_id
在sys.下面有一组系统视图,你所需要的数据资料都可以通过那些视图来查到~~