I'm trying to get the Memory Usage of the SQL SERVER (Total Memory Usage) and available free memory of the system using the query which I got on the internet. The query seems to work for SQL SERVER 2008 but doesn't work on SQL SERVER 2005. The reason being "dm_os_sys_memory" and "dm_os_process_memory " are not available in SQL SERVER 2005.
Note: This should be achieved through queries only, as I don't have permission on machine to use permon and other features provided by windows.
The below mentioned query works in SQL SERVER 2008, please suggest if there is an alternate way
select A.total_physical_memory_kb/1024 as Total_Memory,
A.available_physical_memory_kb/1024 as Free_Memory,
B.physical_memory_in_use_kb/1024 as SQLServer_Memory
from master.sys.dm_os_sys_memory A, master.sys.dm_os_process_memory B;