Click here to monitor SSC
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: 2682 | Views in the last 30 days: 6
 
Related Articles
FORUM

Whoops there goes more drive space

Drive space keeps disappearing

ARTICLE

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.

SCRIPT

Drive Space

Combine Drive Space report for all Servers

SCRIPT

Disk space alert per drive

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

FORUM

Missing Disk Space on Log Drive reappears after reboot

Rebooting reclaims GBs of space on Log Drive

Tags
 
Contribute