Reputation: 941
I am interested in query that I can run against SQL Server 2008 that would tell the memory usage of the current processes (and users running them) executing. Any help would be appreciated. Thank you.
Upvotes: 3
Views: 367
Reputation: 294287
tell the memory usage of the current processes
This is too generic and cannot be answered. Almost all the memory in SQL is shared between 'processes' (queries) and cannot be attributed to an individual one. The only significant memory consumption that can be clearly attributed to a query is the memory grant and that is exposed in sys.dm_exec_query_memory_grants
. I recommend you read also about Buffer Management.
Upvotes: 4
Reputation: 812
You can try something like this:
SELECT *
FROM sys.dm_exec_requests
CROSS APPLY sys.dm_exec_sql_text(sql_handle)
Or you may run:
sp_who
to see all users and processes
But, as Ezi stated, you can just use the SQL Server Profiler tool and run a trace.
Upvotes: 1