calculate size of sql azure database

后端 未结 1 832
春和景丽
春和景丽 2021-01-31 10:53

How can I calculate the current size of a SQL Azure Database? (Not the maximum size limit)

Several places (like this) suggest using this sql:

SELECT SUM         


        
相关标签:
1条回答
  • 2021-01-31 11:53

    This is probably because you're running the query on the master database. If you're using SQL Server Management Studio, choose your database first (not the master database), and execute the query. This should work. Oh and by the way, if you want the size in megabytes, try the following:

    SELECT (SUM(reserved_page_count) * 8192) / 1024 / 1024 AS DbSizeInMB
    FROM    sys.dm_db_partition_stats
    

    OR You can check your database size and its usage through Windows Azure Management Portal also. enter image description here

    Source: https://azure.microsoft.com/en-us/documentation/articles/sql-database-monitoring-with-dmvs/

    0 讨论(0)
提交回复
热议问题