Home Forums SQL Server 2008 SQL Server 2008 - General How can I find the Total free memory in the windows machine where a sqlserver instances are installed? RE: How can I find the Total free memory in the windows machine where a sqlserver instances are installed?

  • Probably, this is what you were looking for!!!

    select

    Name as 'Database'

    , Filename as 'Location'

    , convert(numeric(10,2),round(a.size/128.000,2)) as SizeMB

    , convert(numeric(10,2),round(fileproperty(a.name,'SpaceUsed')/128.000,2)) as UsedSpaceMB

    , convert(numeric(10,2),round((a.size-fileproperty(a.name,'SpaceUsed'))/128.000,2)) as FreeSpaceMB

    , convert(numeric(10,4),round(fileproperty(a.name,'SpaceUsed')/128.000,2)/1000) as UsedSpaceGB

    , convert(numeric(10,4),round((a.size-fileproperty(a.name,'SpaceUsed'))/128.000,2)/1000) as FreeSpaceGB

    from dbo.sysfiles a

    -RP