locked
Installed memory(RAM) in GB RRS feed

  • Question

  • Good morning Experts,

    Could you please let me know if i can get the installed memory(RAM) in GB on a machine from SSMS through a script.

    Kiran

    Wednesday, November 2, 2016 10:20 PM

Answers

  • Hi kiran,

    see Total_Physical_Memory_In_MB.refers following Image.


    Please click Mark As Answer if my post helped.



    • Marked as answer by juniorkiran Thursday, November 3, 2016 4:27 PM
    • Edited by AV111 Friday, November 4, 2016 8:02 AM Remove HTML tags
    Thursday, November 3, 2016 8:35 AM

All replies

  • Hi Kiran,

    -- To get the total physical memory installed on SQL Server

    SELECT [total_physical_memory_kb] / 1024 AS [Total_Physical_Memory_In_MB]
        ,[available_page_file_kb] / 1024 AS [Available_Physical_Memory_In_MB]
        ,[total_page_file_kb] / 1024 AS [Total_Page_File_In_MB]
        ,[available_page_file_kb] / 1024 AS [Available_Page_File_MB]
        ,[kernel_paged_pool_kb] / 1024 AS [Kernel_Paged_Pool_MB]
        ,[kernel_nonpaged_pool_kb] / 1024 AS [Kernel_Nonpaged_Pool_MB]
        ,[system_memory_state_desc] AS [System_Memory_State_Desc]
    FROM [master].[sys].[dm_os_sys_memory]

    --To get the minimum and maximum size of memory configured for SQL Server.
    SELECT [name] AS [Name]
        ,[configuration_id] AS [Number]
        ,[minimum] AS [Minimum]
        ,[maximum] AS [Maximum]
        ,[is_dynamic] AS [Dynamic]
        ,[is_advanced] AS [Advanced]
        ,[value] AS [ConfigValue]
        ,[value_in_use] AS [RunValue]
        ,[description] AS [Description]
    FROM [master].[sys].[configurations]
    WHERE NAME IN ('Min server memory (MB)', 'Max server memory (MB)')

    Refer following link for different version.

    https://basitaalishan.com/2013/01/14/find-the-available-amount-of-memory-available-sql-server-instance-machine/


    Please click Mark As Answer if my post helped.

    Thursday, November 3, 2016 1:01 AM
  • One of the other way, that you might be interested is to use WMI query, which can tell you what type of RAM you are using as well.

    Thursday, November 3, 2016 1:24 AM
  • Thanks a lot for your reply vishe.So, which one should I consider as installed RAM in GB?

    Kiran

    Thursday, November 3, 2016 5:00 AM
  • Hi kiran,

    see Total_Physical_Memory_In_MB.refers following Image.


    Please click Mark As Answer if my post helped.



    • Marked as answer by juniorkiran Thursday, November 3, 2016 4:27 PM
    • Edited by AV111 Friday, November 4, 2016 8:02 AM Remove HTML tags
    Thursday, November 3, 2016 8:35 AM