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 | |
name [FileName] | |
,cast(size*1.0/128 as decimal(18,2)) [FileSizeinMB] | |
,cast(fileproperty(name,'SpaceUsed')/128 as decimal(18,2)) [SpaceUsedMB] | |
,cast(size/128.0 - cast(fileproperty(name,'SpaceUsed') as int)/128.0 as decimal(18,2)) [FreeSpaceMB] | |
,cast(cast(((cast(size as decimal(18,5)) - cast(fileproperty(name,'SpaceUsed') as decimal(18,5))) / size)*100 as decimal(18,2)) as varchar(10))+'%' [VolumeFree] | |
,'MaximumSizeinMB' = | |
case max_size | |
when 0 then 'No growth is allowed.' | |
when -1 then 'Autogrowth is on.' |