当前位置:Gxlcms > 数据库问题 > SQL Server查询数据库表字段类型

SQL Server查询数据库表字段类型

时间:2021-07-01 10:21:17 帮助过:4人阅读

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查询数据库表字段类型

标签:arch   outer   length   HERE   col   varchar   arc   ike   user   

人气教程排行