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 --这是快速查询所有表中的数据量