Find User Connection Count

[cc lang=”sql”] — Show users with highest connections SELECT login_name, session_count, last_batch_time FROM( SELECT login_name ,COUNT(session_id) AS session_count, MAX(last_request_end_time) AS last_batch_time FROM sys.dm_exec_sessions GROUP BY login_name ) t ORDER BY session_count DESC [/cc] In SQL Server 2008 you can also find out how many connections have been created to SQL Server since the last time it got restarted: [cc lang=”sql”] SELECT @@Connections [/cc]

Continue reading ...

Finding the total virtual, shared and AWE memory used

This query shows: Amount of memory allocated to the buffer pool Amount of memory consumed by BPool Amount of memory used by AWE [cc lang=”sql”] SELECT SUM(single_pages_kb + virtual_memory_committed_kb + shared_memory_committed_kb + awe_allocated_kb) as [Used by BPool with AWE, Kb] FROM sys.dm_os_memory_clerks WHERE type = ‘MEMORYCLERK_SQLBUFFERPOOL’ [/cc]

Continue reading ...

Featured Articles

 Site Author

  • Thanks for visiting!
css.php