Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Display Database, File, Free and Total Disk Space

By dave_is_here,

This script displays the size of each SQL Server database and database file plus the size of the next extension that will be added to each file. It also displays on each line the total and remaining free disk space for whichever disk each database file is stored on.

The output is nothing fancy, and could be manipulated in a number of different ways, for example to clearly show which files are not going to be able to extend, which disks are dangerously low on space.

The script can be run from any database, but requires the user to have permissions on a variety of stored procs, the complete list of these is containined in the script heading.

The script was written and tested on SQL Server 2000 on Win2K/WinNT; I don't have enough experience of other version/platform combinations to comment on whether this script will work with them.

Total article views: 1217 | Views in the last 30 days: 3
Related Articles

I need script related to databases

glnp scripts on database


Generate scripts for all databases

Generate scripts for all databases


Scripting Remote Database using SMO in .net

Can't script remote database using script method


Get Detach or Attach all user databases script

Script to generate script to detach or attach user databases


Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones