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

时间:2014-06-28 15:47:24   收藏:0   阅读:226

本文转载自: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 --这是快速查询所有表中的数据量

(转)SQL server 2005查询数据库表的数量和表的数据量,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!