SQL Server查询数据库表字段类型
Posted hualiuliu
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SQL Server查询数据库表字段类型相关的知识,希望对你有一定的参考价值。
select b.name,a.name,c.name,a.xprec,a.xscale
from syscolumns a
left outer join sysobjects b ON a.id=b.id
left outer join systypes c ON c.xusertype=a.xusertype
where b.xtype=‘U‘ AND b.name LIKE ‘%CRM_PS%‘
AND (select systypes.name+‘(‘+cast(a.length/2 as varchar(10))+‘)‘ from systypes where a.xusertype=systypes.xusertype ) LIKE ‘%decimal%‘
order by b.name,a.colid
以上是关于SQL Server查询数据库表字段类型的主要内容,如果未能解决你的问题,请参考以下文章