您的位置:首页 > 数据库

SQL Server 系统表使用-查询指定数据库中用户表及其列、数据类、长度

2006-04-19 13:09 931 查看
select t1.id,t1.name,t2.name,t2.xtype,
case when t2.xtype=56 or t2.xtype=61 then t3.name
else t3.name+'('+convert(varchar,t2.length)+')' end,
case when t2.isnullable=1 then ''
else 'Y' end
from sysobjects t1,syscolumns t2,systypes t3
where t1.xtype='U'and t1.id=t2.id
and t2.xtype=t3.xtype
--and t1.name='CompanyInfo'
order by t1.id,t2.colid
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐