I recently needed to look at table sizes in SQL azure. I had to work out what the biggest table sizes were and see if there is a way to make them smaller. After a bit of searching on the web, I came across this blog entry
http://dunnry.com/blog/CalculatingTheSizeOfYourSQLAzureDatabase.aspx
Which had this bit of SQL which worked really well.
select sum(reserved_page_count) * 8.0 / 1024 from sys.dm_db_partition_stats GO select sys.objects.name, sum(reserved_page_count) * 8.0 / 1024 as S 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 S DESC
Jas
Leave a Reply