select a.Name as 表名, b.Name as 列名, c.Name as 类型, b.max_length as 字节数, b.Precision as 整数位, b.Scale as 小数位 from Sys.tables a inner join Sys.columns b on a.object_id=b.object_id inner join sys.Types c on c.User_Type_ID=b.User_Type_ID
select a.name,b.name,c.name,a.max_length from sys.columns a, sys.objects b,sys.types c where b.type='u' and a.object_id=b.object_id and a.system_type_id=c.system_type_id and b.name='你的表名'
select a.name,b.name from syscolumns a inner join systypes b on a.xusertype=b.xusertype where a.id=object_id('你的表名')
a.Name as 表名,
b.Name as 列名,
c.Name as 类型,
b.max_length as 字节数,
b.Precision as 整数位,
b.Scale as 小数位
from Sys.tables a
inner join Sys.columns b on a.object_id=b.object_id
inner join sys.Types c on c.User_Type_ID=b.User_Type_ID
master 中存放的应该是“建库信息”,建表信息应该在当前数据库中存放这呢??
列的信息都在里面,,xusertype ,length。。写个case when 什么的试试
where b.type='u' and a.object_id=b.object_id
and a.system_type_id=c.system_type_id
and b.name='你的表名'