Featured

Get Total Database Size for All Databases On Server

You can use this script to get ALL the database sizes combined in MB, GB, and TB.

select
'server' = @@servername
, 'total size in megabytes'= convert(decimal(10,2),(sum(size * 8.00) / 1024.00 ))
, 'total size in gigabytes' = convert(decimal(10,2),(sum(size * 8.00) / 1024.00 / 1024.00))
, 'total size in terabytes' = convert(decimal(10,2),(sum(size * 8.00) / 1024.00 / 1024.00 / 1024.00)) from
sys.master_files

Here’s a quick screenshot:
00594

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s