OS Memory

  • Hi,

    I'm putting together a script to run some audit checks(various different things).

    I'm just wondering if there is any TSQL to return the Total RAM on a server to SSMS?

    I know there are a million other ways of doing this but I'd like to get store the script and run it whenever we have a request and I'd like to try and keep it all in TSQL.

    Any help would be great.

    Thanks in advance

  • Here you go

    SELECT total_physical_memory_kb

    FROM sys.dm_os_sys_memory

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

  • Vets5 (11/6/2012)


    Hi,

    I'm putting together a script to run some audit checks(various different things).

    I'm just wondering if there is any TSQL to return the Total RAM on a server to SSMS?

    I know there are a million other ways of doing this but I'd like to get store the script and run it whenever we have a request and I'd like to try and keep it all in TSQL.

    Any help would be great.

    Thanks in advance

    select

    physical_memory_in_bytes /1024.00 /1024.00 /1024.00

    from sys.dm_os_sys_info

    Mine returns 511.9882812 and we have 512 GB of RAM in the server.

  • Thanks guys!

    Exacly what I'm looking for... Here is how mine looks

    SELECT physical_memory_in_bytes / 1073741824 as 'Physical OS Memory in GB'

    FROM sys.dm_os_sys_info

    Works a treat!

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply