SHARE
TWEET

All Index Size

cbossie Mar 24th, 2020 198 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2. OBJECT_SCHEMA_NAME(i.OBJECT_ID) AS SchemaName,
  3. OBJECT_NAME(i.OBJECT_ID) AS TableName,
  4. i.name AS IndexName,
  5. i.index_id AS IndexID,
  6. 8 * SUM(a.used_pages) AS 'Indexsize(KB)'
  7. FROM sys.indexes AS i
  8. JOIN sys.partitions AS p ON p.OBJECT_ID = i.OBJECT_ID AND p.index_id = i.index_id
  9. JOIN sys.allocation_units AS a ON a.container_id = p.partition_id
  10. GROUP BY i.OBJECT_ID,i.index_id,i.name
  11. ORDER BY OBJECT_NAME(i.OBJECT_ID),i.index_id
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top