这里是普通文章模块栏目内容页
查询数据库里各个表的记录总数,占用空间数:

select b.name,a.rowcnt from sysindexes a,sysobjects b
where a.id=b.id and a.indid<=2 and b.xtype=’u’

rowcnt bigint 基于 indid = 0 和 indid = 1 的数据级行计数。

故用a.indid <= 2

单个表记录数,占用空间数:sp_spaceused ‘bdorder’

数据库所有表各个记录数,占用空间数:
EXEC sp_MSforeachtable @command1=”sp_spaceused ‘?’”