Created
September 2, 2017 23:03
-
-
Save petesql/5851e049f6513ee10caa017d352f7595 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT DISTINCT vs.volume_mount_point, vs.file_system_type, | |
vs.logical_volume_name, CONVERT(DECIMAL(18,2),vs.total_bytes/1073741824.0) AS [Total Size (GB)], | |
CONVERT(DECIMAL(18,2), vs.available_bytes/1073741824.0) AS [Available Size (GB)], | |
CONVERT(DECIMAL(18,2), vs.available_bytes * 1. / vs.total_bytes * 100.) AS [Space Free %] | |
FROM sys.master_files AS f WITH (NOLOCK) | |
CROSS APPLY sys.dm_os_volume_stats(f.database_id, f.[file_id]) AS vs | |
ORDER BY vs.volume_mount_point OPTION (RECOMPILE); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment