go
select db_name() as DbName, name as LogicalFileName, filename as PhysicalFileName,
convert(decimal(12,2),round(a.size/128.000,2)) as FileSizeMB,
convert(decimal(12,2),round(fileproperty(a.name,'SpaceUsed')/128.000,2)) as SpaceUsedMB, convert(decimal(12,2),round((a.size-fileproperty(a.name,'SpaceUsed'))/128.000,2)) as FreeSpaceMB
from dbo.sysfiles a
No comments:
Post a Comment