Skip to content

Latest commit

 

History

History
61 lines (48 loc) · 2.88 KB

sys-dm-pdw-exec-connections-transact-sql.md

File metadata and controls

61 lines (48 loc) · 2.88 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic dev_langs monikerRange
sys.dm_pdw_exec_connections (Transact-SQL)
sys.dm_pdw_exec_connections returns information about the connections established to this instance of Azure Synapse Analytics and the details of each connection.
WilliamDAssafMSFT
wiassaf
randolphwest
07/29/2024
sql
data-warehouse
reference
TSQL
>=aps-pdw-2016 || =azure-sqldw-latest

sys.dm_pdw_exec_connections (Transact-SQL)

[!INCLUDE applies-to-version/asa-pdw]

Returns information about the connections established to this instance of [!INCLUDE ssazuresynapse-md] and the details of each connection.

Note

[!INCLUDE synapse-analytics-od-unsupported-syntax] For serverless SQL pool use sys.dm_exec_connections.

Column name Data type Description
session_id int Identifies the session associated with this connection. Use SESSION_ID to return the session_id of the current connection.
connect_time datetime Timestamp when connection was established. Not nullable.
encrypt_option nvarchar(40) Indicates TRUE (connection is encrypted) or FALSE (connection isn't encrypted).
auth_scheme nvarchar(40) Specifies [!INCLUDE ssNoVersion] or Windows authentication scheme used with this connection. Not nullable.
client_id varchar(48) IP address of the client connecting to this server. Nullable.
sql_spid int The session ID of the connection. Use @@SPID to return the sql_spid of the current connection. For most purposes, use the session_id instead.

Permissions

Requires VIEW SERVER STATE permission on the server.

Relationship cardinalities

From To Relationship
dm_pdw_exec_sessions.session_id dm_pdw_exec_connections.session_id One-to-one
dm_pdw_exec_requests.connection_id dm_pdw_exec_connections.connection_id Many to one

Examples: [!INCLUDE ssazuresynapse-md] and [!INCLUDE ssPDW]

The following Transact-SQL example is a typical query to gather information about a query's own connection.

SELECT
    c.session_id, c.encrypt_option,
    c.auth_scheme, s.client_id, s.login_name,
    s.status, s.query_count
FROM sys.dm_pdw_exec_connections AS c
JOIN sys.dm_pdw_exec_sessions AS s
    ON c.session_id = s.session_id
WHERE c.session_id = SESSION_ID();

Related content