您的位置:首页 > 数据库

(转)SQL server 2005查询数据库表的数量和表的数据量

2014-06-19 21:50 411 查看
本文转载自:http://hi.baidu.com/ajyajyajy/item/4e2a7f4dc83393d2c1a592c1

use DBNAME
go
select * from sysobjects where xtype='U'; --这是查询所有表的信息
select count(*) from sysobjects where xtype='U' --这是查询表的数量

‍select a.name, b.rows from sysobjects a with(nolock) join sysindexes b with(nolock) on b.id=a.id where a.xtype='U' and b.indid in (0,1) order by a.name asc --这是快速查询所有表中的数据量
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐