SQL Server Memory – How to Get Minimum and Maximum Memory Allocation Using T-SQL

memorysqlsql serversql-server-2008-r2tsql

I'm managing about 90 SQL Server instances and need a query to determine how much memory has been allocated to each instance. Please note, I'm not asking how to set it, just to see what it's currently set to without using the Management Studio.

Thanks for your help.

Best Answer

Try this on the master database:

SELECT name, value, value_in_use, [description] 
FROM sys.configurations
WHERE name like '%server memory%'
ORDER BY name OPTION (RECOMPILE);

Gives you max server memory (MB) and min server memory (MB)