qpi icon indicating copy to clipboard operation
qpi copied to clipboard

Error in qpi.volumes

Open schneiderb opened this issue 2 years ago • 0 comments

Hi there,

just realized there is a small errror in the view qpi.volumes, used_gb should be total_gb and total_gb should be used_gb while substracting available_bytes from total_bytes.

CREATE VIEW qpi.volumes AS SELECT volume_mount_point, total_gb = CAST(MIN(total_bytes / 1024. / 1024 / 1024) AS NUMERIC(10,1)), available_gb = CAST(MIN(available_bytes / 1024. / 1024 / 1024) AS NUMERIC(10,1)), used_gb = CAST(MIN((total_bytes-available_bytes) / 1024. / 1024 / 1024) AS NUMERIC(10,1)) FROM sys.master_files AS f CROSS APPLY sys.dm_os_volume_stats(f.database_id, f.file_id) GROUP BY volume_mount_point; GO

schneiderb avatar Nov 17 '23 08:11 schneiderb