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)

How much space could you get shrinking all databases

By Gonzalo Moles,

This is script is useful when you are short of space on a drive and you need to know how much space can you get shrinking your databases. Although is shrinking is not a recommended practice some times you need to get free space in your drive. Just execute the script and it will tell you the free space you can obtain.

You gan modify the line where[UsageType] = 'data'  to specify log or data files.

As well you can uncomment the line --where MB_Free < 5000 to specify drives with less than 'x mbytes'.

Total article views: 2659 | Views in the last 30 days: 8
Related Articles

Whoops there goes more drive space

Drive space keeps disappearing


Drive Space

Combine Drive Space report for all Servers


Disk space alert per drive

This script validates the sufficient disk space per drive. When you'll reach a minimum on a diskdri...


Missing Disk Space on Log Drive reappears after reboot

Rebooting reclaims GBs of space on Log Drive


Drive Space

I found a cool series of scripts from Jeremiah Peschka on getting disk space from SQL Server. They’r...


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