Return to Snippet

Revision: 25853
at April 12, 2010 08:24 by tvanzele

Initial Code
SELECT OBJECT_NAME(ps.[object_id]) AS [TableName], AS [IndexName], SUM(ps.row_count) AS [RowCount]
FROM sys.dm_db_partition_stats AS ps
INNER JOIN sys.indexes AS i 
ON i.[object_id] = ps.[object_id] 
AND i.index_id = ps.index_id 
WHERE i.type_desc IN ('CLUSTERED','HEAP')
AND i.[object_id] > 100
AND OBJECT_SCHEMA_NAME(ps.[object_id]) <> 'sys'
GROUP BY ps.[object_id],
ORDER BY SUM(ps.row_count) DESC;

Initial URL

Initial Description

Initial Title
Page and row-count information for every partition in the current database

Initial Tags

Initial Language