SQL Azure table size

前端 未结 3 768
别那么骄傲
别那么骄傲 2021-01-29 23:52

In mssql2005 when I want to get size of table in MBs, I use EXEC sp_spaceused \'table\'.

Is there any way to get space used by particular table in SQL Azure using some q

3条回答
  •  粉色の甜心
    2021-01-30 00:05

    This way you can have the bigger on top:

     SELECT  sys.objects.name,
                SUM(row_count) AS 'Row Count',
                SUM(reserved_page_count) * 8.0 / 1024 AS 'Table Size (MB)'
        FROM sys.dm_db_partition_stats, sys.objects
        WHERE sys.dm_db_partition_stats.object_id = sys.objects.object_id
        GROUP BY sys.objects.name
        ORDER BY [Table Size (MB)] DESC
    

    Source

提交回复
热议问题