Home > Database > Mysql Tutorial > Atitit.mssql数据库表记录数and表体积大小统计

Atitit.mssql数据库表记录数and表体积大小统计

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:05:20
Original
1210 people have browsed it

Atitit.mssql 数据库表记录数and 表体积大小统计 1. EXEC sp_MSforeachtable EXECUTE sp_spaceused ? 最后一种方法是利用隐藏未公开的系统存储过程sp_MSforeachtable CREATE TABLE #temp (TableName VARCHAR (255), RowCnt INT) EXEC sp_MSforeachtable INSE

Atitit.mssql 数据库表记录数and 表体积大小统计

1. EXEC sp_MSforeachtable "EXECUTE sp_spaceused '?'"

最后一种方法是利用隐藏未公开的系统存储过程sp_MSforeachtable

CREATE TABLE #temp (TableName VARCHAR (255), RowCnt INT)

EXEC sp_MSforeachtable 'INSERT INTO #temp SELECT ''?'', COUNT(*) FROM ?'

SELECT TableName, RowCnt FROM #temp ORDER BY TableName

DROP TABLE #temp

从mssql6.5开始,微软提供了两个不公开,非常有用的系统存储过程sp_MSforeachtable和sp_MSforeachdb,用于遍历某个数据库的每个表和遍历DBMS管理下的每个数据库。

作者:: 老哇的爪子 Attilax 艾龙, EMAIL:1466519819@qq.com

转载请注明来源: http://blog.csdn.net/attilax

2. 查询首先通过sysobjects表

3. 参考

SQLSERVER中统计所有表的记录数 - minisunny的专栏 - 博客频道 - CSDN.NET.htm

我要啦免费统计
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template