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)
Thank this author by sharing:
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.
where[UsageType] = 'data'
As well you can uncomment the line --where MB_Free < 5000 to specify drives with less than 'x mbytes'.
--where MB_Free < 5000
Drive space keeps disappearing
How to monitor drive space in T-SQL and calculate when your drives will run out of space.
Combine Drive Space report for all Servers
This script validates the sufficient disk space per drive.
When you'll reach a minimum on a diskdri...
Rebooting reclaims GBs of space on Log Drive