Today’s quick tip: get the size of your database in SQL Server (including SQL Azure) by using a T-SQL statement.
Connect to your database, and execute this query:
SELECT ( (SUM(Reserved_Page_Count) * 8.0) / 1024 / 1024 ) AS DatabaseSizeInGigabytes FROM sys.dm_db_partition_stats
Very useful in Azure where it’s not easy or apparent to get the database’s total size.