---
title: "Discussion on \"Get size of all tables in database\" | Hashnode"
description: "Discussion on \"Get size of all tables in database\". SELECT \n  o.name AS ObjectName, \n  SUM(reserved_page_count) * 8.0 / 1024 AS SizeinMB \nFROM \n  sys.dm_db_partition_stats AS ps \n  INNER JOIN sys.sysobjects AS o ON ps.object_id = o.id \nGROUP BY \n  o.name \nORDER BY \n  SizeinMB DESC;"
url: "https://hashnode.com/posts/get-size-of-all-tables-in-database/63bff906aca2cea7fc424915"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Get size of all tables in database](https://blog.rinoreji.in/get-size-of-all-tables-in-database?utm_source=hashnode&utm_medium=feed)

SELECT o.name AS ObjectName, SUM(reserved\_page\_count) \* 8.0 / 1024 AS SizeinMB FROM sys.dm\_db\_partition\_stats AS ps INNER JOIN sys.sysobjects AS o ON ps.object\_id = o.id GROUP BY o.name ORDER BY SizeinMB DESC;

Jan 12, 2023 · 1 min read · blog.rinoreji.in  
Read the article

-   [#sql-server](https://hashnode.com/tag/sql-server)

## Written by

[Rino Reji Cheriyan](https://hashnode.com/@rinoreji)

@rinoreji

  
[View profile](https://hashnode.com/@rinoreji)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
