SQL Clone
SQLServerCentral is supported by Redgate
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: 1233 | Views in the last 30 days: 4
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