I am trying to select 15% of disk space available in a server.
SELECT DISTINCT
s.volume_mount_point [Drive],
CAST(s.available_bytes / 1048576.0 as decimal(20,2)) [AvailableMBs],
((CAST(s.total_bytes / 1048576.0 as decimal(20,2)))*15)/100 AS [FifteenpercentAvailableMBs]
FROM
sys.master_files f
CROSS APPLY sys.dm_os_volume_stats(f.database_id, f.[file_id]) s
This query works well in Microsoft SQL Server 2008 R2 (SP2)
But it wont work in Microsoft SQL Server 2008 R2 (RTM)
How can I make this query work in 2008 R2 RTM? (I mean is there any alternative query that I can use to get 15% of available space?)