[SQLServer]查詢目前連線數 及 連線明細 的指令
目前連線數
USE master SELECT cntr_value AS User_Connections FROM sys.sysperfinfo AS sp WHERE sp.object_name='SQLServer:General Statistics' AND sp.counter_name='User Connections'
連線明細
USE master SELECT c.session_id, c.connect_time, s.login_time, c.client_net_address, s.login_name, s.status FROM sys.dm_exec_connections c left join sys.dm_exec_sessions s on c.session_id = s.session_id
參考:
http://mark528.pixnet.net/blog/post/62330671-%E5%A6%82%E4%BD%95%E6%9F%A5%E8%A9%A2sql-server%E7%9B%AE%E5%89%8D%E9%80%A3%E7%B7%9A%E6%95%B8
留言
張貼留言