<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Index Size on SQL Server Scripts</title><link>https://www.sqlserver70.com/tags/index-size/</link><description>Recent content in Index Size on SQL Server Scripts</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>SQLServer70.com</copyright><lastBuildDate>Sun, 24 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.sqlserver70.com/tags/index-size/index.xml" rel="self" type="application/rss+xml"/><item><title>SQL Server Get Table and Index Storage Size Report Script</title><link>https://www.sqlserver70.com/post/sql-server-get-table-and-index-storage-size/</link><pubDate>Sun, 24 May 2026 00:00:00 +0000</pubDate><guid>https://www.sqlserver70.com/post/sql-server-get-table-and-index-storage-size/</guid><description>
&lt;p&gt;Knowing how much space each table and each index consumes is the foundation of capacity planning, archive policy, and index cleanup decisions on any SQL Server instance. This T-SQL script reads the partition-level storage statistics out of &lt;code&gt;sys.dm_db_partition_stats&lt;/code&gt; and reports the size of every index — clustered, non-clustered, and the heap row that represents the table itself — in both kilobytes and megabytes, schema- and table-named for easy review.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="8593449130"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="purpose-and-overview"&gt;Purpose and Overview&lt;/h2&gt;
&lt;p&gt;Backup windows that creep, restore tests that get skipped, archive policies that never get written — all three trace back to the same missing input: a current, per-object inventory of bytes-on-disk. &lt;code&gt;sys.dm_db_partition_stats&lt;/code&gt; carries the page counts that answer the question; &lt;code&gt;sp_spaceused&lt;/code&gt; only aggregates at the table or database level and loses the index-by-index detail this kind of capacity work needs. The query below converts those page counts to KB and MB for every index and every table in the current database, ready to paste into the next capacity-planning spreadsheet.&lt;/p&gt;</description></item></channel></rss>