MCITP

MCITP

Thursday, March 10, 2011

To see available free space on db files:

use
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