Bug in SQL Azure documentation on how to calculate DB size.

A fellow Windows Azure MVP, Rainer Stroper, had a very interesting case recently were he got a “reached quota” message for his SQL Azure database, although the query was indicating he was using about ~750MB on a 1GB size Web Edition database.

The problem was narrowed done to a bug in the documentation ( http://msdn.microsoft.com/en-us/library/ff394114.aspx) and the correct one to use is this, as per Microsoft’s Support suggestion:

SELECT SUM(reserved_page_count)*8.0/1024 + SUM(lob_reserved_page_count)*8.0/1024 FROM sys.dm_db_partition_stats

in order to take accruate metrics.

Be sure you use that, so you won’t have any unpleasant suprises.



  1. PK says:

    I have both queries same result. SUM(lob_reserved_page_count)*8.0/1024 is Zero in my case.

    Windows Azure portal showing database size is 8.9 MB but both queries showing 5.53 MB

Leave a Reply