Calculating table sizes on SQL Azure
- August 2nd, 2011
- Posted in Uncategorized
- By Germán Medina
- Write comment
This query will retrieve the rounded (2) size (MB) of all your tables on a SQL Azure database.
select
sys.objects.name,
cast(round(sum(reserved_page_count) * 8.0 / 1024, 2) as float) as size
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
size desc
No comments yet.