BACK

1
Posted by albydarned 5 years ago
As you may know, COUNT(*) if often very slow on large tables. With this query I have been able to que...

SELECT SUM (row_count)
FROM sys.dm_db_partition_stats
WHERE object_id=OBJECT_ID('TableName')   
AND (index_id=0 or index_id=1);