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
查询在指定的数据库中所有的表名和每个表的字段名及字段类型
最新推荐文章于 2024-08-14 09:08:52 发布