Skip to main content
InSource Solutions

TN PT123 How to get Connection ID's from a MS SQL Query




This article from InSource shows how to get the Connection ID's from MS SQL Server sessions.

  • Author: Rufus Handsome
  • Published: 08/17/2018
  • Applies to: MS SQL Server 2014


Using this query in SQL Management Studio:

select a.session_id, a.login_time, a.host_name, a.login_name, a.login_time,a.session_id,b.connection_id from sys.dm_exec_sessions a , sys.dm_exec_connections b where a.session_id=b.session_id

Connection_ID Query.png