Script for all database file sizes

Here is script to get the file sizes of your db files:
The results are ordered by the file size descending.
So you can see what’s taking up all your hard drive space.

select physical_name, size, CONVERT(DECIMAL(10,2),(size * 8.00) / 1024.00) As UsedSpace
from master.sys.master_files
order by size desc

Advertisements

Got something to add?

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