得到数据库中所有的表以及表字段
来源:互联网 发布:java jsonarray 添加 编辑:程序博客网 时间:2024/05/01 03:46
邹建写的
AbateTime 1 ProductNo int 10 0 4 √ √
2 AbateDays int 10 0 4
4 NextDays int 10 0 4 √ (0)
5 ifauto int 10 0 4 √ (0)
AdvManage 1 No int 10 0 4 √
select case when c.colid=1 then o.name else '' end 表名, --得到表名,重复的表名不显示
c.colid 顺序,
c.name 字段名,
t.name 字段类型,
columnproperty(c.id,c.name,'PRECISION') 字段长度,
isnull(c.Scale,'') 小数位,
c.length 占用字节,
case when c.isnullable=1 then '√' else '' end 可为空,
case when c.colid in(select ik.colid
from sysindexes i, Sysindexkeys ik, sysobjects oo
where i.id=ik.id and i.indid=ik.indid
and i.name=oo.name and oo.xtype='PK' --主键
and o.id=i.id
) then '√' else '' end 主键,
case when c.colid in(select ik.colid
from sysindexes i, Sysindexkeys ik
where i.id=ik.id and i.indid=ik.indid
and o.id=i.id and i.indid=1 --聚类索引
) then '√' else '' end 聚类索引,
case when columnproperty( c.id, c.name,'IsIdentity')=1 then '√' else '' end 自增长,
isnull(m.text,'') 默认值
from sysobjects o, syscolumns c, systypes t, syscomments m
where o.xtype='U'
and o.id=c.id
and c.xtype=t.xtype
and c.cdefault*=m.id
order by o.name, c.colid
c.colid 顺序,
c.name 字段名,
t.name 字段类型,
columnproperty(c.id,c.name,'PRECISION') 字段长度,
isnull(c.Scale,'') 小数位,
c.length 占用字节,
case when c.isnullable=1 then '√' else '' end 可为空,
case when c.colid in(select ik.colid
from sysindexes i, Sysindexkeys ik, sysobjects oo
where i.id=ik.id and i.indid=ik.indid
and i.name=oo.name and oo.xtype='PK' --主键
and o.id=i.id
) then '√' else '' end 主键,
case when c.colid in(select ik.colid
from sysindexes i, Sysindexkeys ik
where i.id=ik.id and i.indid=ik.indid
and o.id=i.id and i.indid=1 --聚类索引
) then '√' else '' end 聚类索引,
case when columnproperty( c.id, c.name,'IsIdentity')=1 then '√' else '' end 自增长,
isnull(m.text,'') 默认值
from sysobjects o, syscolumns c, systypes t, syscomments m
where o.xtype='U'
and o.id=c.id
and c.xtype=t.xtype
and c.cdefault*=m.id
order by o.name, c.colid
AbateTime 1 ProductNo int 10 0 4 √ √
2 AbateDays int 10 0 4
4 NextDays int 10 0 4 √ (0)
5 ifauto int 10 0 4 √ (0)
AdvManage 1 No int 10 0 4 √
- 得到数据库中所有的表以及表字段
- 如何得到数据库中所有表字段及字段中文描述
- 如何得到数据库中所有表字段及字段中文描述
- 如何得到数据库中所有表字段及字段中文描述
- 如何得到数据库中所有表字段及字段中文描述
- 如何得到数据库中所有表字段及字段中文描述
- 得到SQL数据库中所有表字段及字段中文描述
- 如何得到数据库中所有表字段及字段中文描述
- oracle查询表字段以及所有表
- MS SQL 查询数据库中所有索引以及对应的表字段 SQL Server Profiler性能跟踪
- 得到两个数据库 不同的表( 统计列 升级 用户表 表字段相差个数)
- [转]delphi中获得数据库中所有表名和表字段
- 取得数据库中所有表字段及字段中文描述的SQL语句 sql2005
- sql 查询所有数据库、表名、表字段总结
- sql 查询所有数据库、表名、表字段总结
- sql ---查询所有数据库、表名、表字段总结
- sql 查询所有数据库、表名、表字段总结
- SQL 查询所有数据库,表名,表字段总结
- IList转DataSet(支持Nullable)
- Login VC++ 使用ADO实例
- POJO
- .bashrc和profile的异同
- 在一个存储过程中调用返回一个游标的另一个存储过程
- 得到数据库中所有的表以及表字段
- 如何配置驱动程序开发环境
- Hibernate的lazy问题
- 说一说等价关系
- awk study(4)
- aspjpeg 注册码和注册方法
- 次级贷!
- 什么是交叉编译(转)
- XSDL教程[w3c]