问一个统计数据库中所有数据表数据量的问题~~
问一个统计数据库中所有数据表数据量的问题:   
       我的一个数据库中可能几百张表,我想用一个办法(或者SQL语句)能够查询出这几百张表每张表有多少条数据记录,并且能够按照表数据记录的多少,对表进行排序。   
       谢谢~~~~~~~~~~~~~
------解决方案--------------------  --加排序 
 select o.name,i.rows from sysindexes i,sysobjects o 
 where i.id=o.id 
 and i.indid <2 
 and o.xtype= 'u ' 
 order by i.rows desc
------解决方案--------------------create table #t(tname varchar(40),counts int)   
 declare @s varchar(8000) 
 select @s=isnull(@s, ' ')+ ' insert into #t select  ' ' '+name+ ' ' ',(select count(*) from  '+name+ ') ' from sysobjects  
 where type= 'U '   
 exec(@s)   
 select * from #t order by counts desc
------解决方案--------------------sp_msforeachtable  'select  ' '? ' ',count(*) from ?  '