How to Check Table Sizes in SQL Server

Last updated July 25, 2026 · By the SaturnSQL team

EXEC sp_spaceused 'table' reports row count and reserved space for one table. For every table at once, aggregate sys.dm_db_partition_stats, which is fast and needs no locks on the tables themselves.

EXEC sp_spaceused 'orders';

All tables, largest first

SELECT s.name AS schema_name,
       t.name AS table_name,
       SUM(CASE WHEN p.index_id IN (0, 1) THEN p.row_count ELSE 0 END) AS total_rows,
       SUM(p.reserved_page_count) * 8 / 1024 AS reserved_mb
FROM sys.dm_db_partition_stats p
JOIN sys.tables t ON t.object_id = p.object_id
JOIN sys.schemas s ON s.schema_id = t.schema_id
GROUP BY s.name, t.name
ORDER BY reserved_mb DESC;

Run this in SaturnSQL

SaturnSQL is a browser-based SQL editor for teams: shared query library, schema-aware autocomplete, and scheduled exports to Google Sheets and Slack.

Try it free

Related SQL Server guides

© 2026 Panda Capital Oy Ab. All rights reserved.