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)

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: 2703 | Views in the last 30 days: 1
Related Articles

Whoops there goes more drive space

Drive space keeps disappearing


Time and Space: How to Monitor Drive Space in SQL Server

How to monitor drive space in T-SQL and calculate when your drives will run out of space.


Drive Space

Combine Drive Space report for all Servers


Capture Linux Drive Space data with Powershell

Capture Linux Drive Space data with Powershell using Posh-SSH module


Disk space alert per drive

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