Agent Jobs

Get All Database Size In SQL Server

Use this script to get the database size of ALL databases.

select
'database' = db_name(database_id)
, 'size in gb' = convert(decimal(10,2),(sum(size * 8.00) / 1024.00 / 1024.00)) from
sys.master_files
group by
database_id
, size
order by
size desc
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