Get Database Sizes in SQL Server

Knowing how much disk space your databases are consuming in SQL Server is an important thing to know and monitor as a Database Administrator. As well as this, we should be looking at future growth of database files, ensuring we have enough disk space for years to come.

It takes more than a few SQL scripts in a blog post to get to know your disk space requirements of a SQL Server. The scripts I provide here do help though, and give a good quick glance at database sizes, including how full the data files are.

There’s many ways to show database sizes in SQL Server. As a DBA, it’s always great to have SQL scripts to get this info which I share below.

SQL Script to Show Database Sizes in SQL Server

The script below will return all databases sizes (MB & GB) for a SQL Server instance:

Get Database Sizes SQL Server

I often bring up the Shrink File window in SSMS as shown above to view the data and log file sizes. From this window we can easily check how full our database file(s) and log files are. .


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *