If you want to see how much size has you used in your SQL Azure database, you can definitely see it on the SQL Azure Developer Portal as shown below.
However, for some reason, sometimes you would either need to get the size more precisely or retrieve the numbers programmatically.
Here’s the query for you to retrieve the size of your database.
select
sum(reserved_page_count) * 8.0 / 1024 as ''Database Size''
from
sys.dm_db_partition_stats
After running in on my SQL Server Management Studio R2, here’s the result:
If you need to explore in more detail how much size for each table, you can also use the following query to see.
select
sys.objects.name as ''TableName'', sum(reserved_page_count) * 8.0 / 1024 as ''Size (in 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
You may want to learn more about SQL Azure tips and tricks, be sure to check out the following posts:
Hope this helps.

Categories
Tag Cloud
Blog RSS
Comments RSS
Last 50 Posts
Back
Back
Void
Life
Earth
Wind « Default
Water
Fire
Light 