sql server查询数据库总数据条数
Posted 一叶知秋。
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql server查询数据库总数据条数相关的知识,希望对你有一定的参考价值。
1:
select
sum(c.row_count) as datacount
from sys.indexes a ,
sys.objects b ,
sys.dm_db_partition_stats c
where a.[object_id] = b.[object_id]
AND b.[object_id] = c.[object_id]
AND a.index_id = c.index_id
AND a.index_id < 2
AND b.is_ms_shipped = 0
2:
select b.name as tablename ,
a.rowcnt as datacount
from sysindexes a ,
sysobjects b
where a.id = b.id
and a.indid < 2
and objectproperty(b.id, ‘IsMSShipped‘) = 0
以上是关于sql server查询数据库总数据条数的主要内容,如果未能解决你的问题,请参考以下文章