查看数据库中的记录数
来源:互联网 发布:卧龙大数据 编辑:程序博客网 时间:2024/06/08 03:36
SELECT o.name AS "Table Name", i.rowcnt AS "Row Count"
FROM sysobjects o, sysindexes i
WHERE i.id = o.id
AND indid IN(0,1)
--This specifies 'user' databases only
AND lower(xtype) = 'u' --Added by James_DBA
--This omits the diagrams table of the database
--You may find other system tables will need to be ommitted,
--you would just name them all here using the <> operator
--i.e. o.name <> dtproperties, o.name <> 'sysdiagrams'
AND o.name <> 'sysdiagrams' --Added by James-DBA
--You could also look further into filtering out temp tables,
--or user specified tables
ORDER BY i.rowcnt DESC --I found it more useful to display
--the results by 'Row Count' Descending
--The original posting suggested to sort by Table name by
--using the following line, instead of the line I use above:
--ORDER BY o.name
--The following line adds up all the rowcount results and places
--the final result into a seperate column (below the first resulting table)
COMPUTE SUM(i.rowcnt); --Added by James_DBA
FROM sysobjects o, sysindexes i
WHERE i.id = o.id
AND indid IN(0,1)
--This specifies 'user' databases only
AND lower(xtype) = 'u' --Added by James_DBA
--This omits the diagrams table of the database
--You may find other system tables will need to be ommitted,
--you would just name them all here using the <> operator
--i.e. o.name <> dtproperties, o.name <> 'sysdiagrams'
AND o.name <> 'sysdiagrams' --Added by James-DBA
--You could also look further into filtering out temp tables,
--or user specified tables
ORDER BY i.rowcnt DESC --I found it more useful to display
--the results by 'Row Count' Descending
--The original posting suggested to sort by Table name by
--using the following line, instead of the line I use above:
--ORDER BY o.name
--The following line adds up all the rowcount results and places
--the final result into a seperate column (below the first resulting table)
COMPUTE SUM(i.rowcnt); --Added by James_DBA
- 查看数据库中的记录数
- dbms_rowid查看每个块中的记录数
- mysql查看各个表中的记录数
- 查看数据库表中的列数
- mysql 查看数据库中所有表的记录数
- mysql 查看数据库中所有表的记录数
- mysql 查看数据库中所有表的记录数
- mysql 查看数据库中所有表的记录数
- mysql 查看数据库中所有表的记录数
- 统计一个数据库中的每个表的记录数
- 得到 所有数据库中,所有用户表中的记录数
- 得到数据库中admin表中的总记录数
- ADO访问数据库获取 Recordset 对象中的记录数
- 查看数据库活动连接数
- 查看数据库活动连接数
- 查看数据库的连接数
- 查看数据库活动连接数
- 查看数据库表记录数
- 流行技术我该学哪样?--给刚进入IT的朋友的一封信
- 路由器实现vlan通讯
- Excel 表格中存在的数据用oledb方式得到的值为null的现象解析及解决办法
- 让DIV居中的CSS
- 2009年煤炭价格走势预测
- 查看数据库中的记录数
- OEMGetExtensionDRAM and OEMEnumExtensionDRAM
- 全球牛奶饮料的消费情况分析
- Fedora 8 Linux下GRUB配置文件详细解析
- 做事情要定阶段性里程碑
- DSOfile,一个修改windows系统文件摘要的好东东。
- IT管理人才必备的十大能力
- Css基础学习
- 破解asp网页sql注入漏洞