SELECT   ROWS
FROM   sysindexes
WHERE   id=OBJECT_ID( 'InboundPlan')
    AND   indid <2

--查询库内各表
select so.name as 'TableName', so.type,SUM(row_count) as 'TotalRows' 
from sys.dm_db_partition_stats as ps inner join sys.objects as so 
        on ps.object_id=so.object_id 
where index_id<=1 and so.type='U' 
group by so.name,so.type 
order by sum(row_count) desc

 除COUNT(*)外,上面就是查询表自己知道的最快的方法了,记录一下。

补充一个

---查询整个实例的数据库容量
SP_HELPDB

 

相关文章:

  • 2022-02-01
  • 2022-01-25
  • 2021-08-29
  • 2022-12-23
  • 2022-12-23
  • 2021-09-29
  • 2021-10-24
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-20
  • 2021-11-26
  • 2021-11-29
  • 2021-08-09
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案