Created
May 11, 2012 00:13
-
-
Save rberrelleza/2656731 to your computer and use it in GitHub Desktop.
Query to see the size of all tables on a DB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select sysobj.name, sum(reserved_page_count) * 8.0 / 1024 as 'total size (MB)' | |
from sys.dm_db_partition_stats sysstats, sys.objects sysobj | |
where sysstats.object_id = sysobj.object_id and sysobj.schema_id = schema_id('dbo') | |
group by sysobj.name; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment