What connection do internal sessions belong to in MS SQL Server?
-
12-01-2021 - |
Question
By querying
select * from sys.dm_exec_connections
I do not see corresponding connections for internal sessions, about the existance of which I know from sys.dm_exec_sessions DMV. My questions is whether do they need a connection to run and how can I find out their connection ID, if the connection exists(because I can't join on dm_exec_connections)?
Thanks!
Solution
The internal sessions < 50 are background processes, and have no corresponding connection, which is why you won't see them show up in
sys.dm_exec_connections
.
The connections are reffered to as external user processes apart from the internal processes.
Note also, as Dan Guzman added:
System sessions in newer SQL Server versions may have session_id values > 50. These can be identified by is_user_process = 0 in sys.dm_exec_sessions