sys.dm_tran_session_transactions (Transact-SQL)

sys.dm_tran_session_transactions (Transact-SQL)

 

THIS TOPIC APPLIES TO: yesSQL Server (starting with 2008)yesAzure SQL DatabaseyesAzure SQL Data Warehouse yesParallel Data Warehouse

Returns correlation information for associated transactions and sessions.

System_CAPS_ICON_note.jpg Note


To call this from Azure SQL Data Warehouse or Parallel Data Warehouse, use the name sys.dm_pdw_nodes_tran_session_transactions.

Column nameData typeDescription
session_idintID of the session under which the transaction is running.
transaction_idbigintID of the transaction.
transaction_descriptorbinary(8)Transaction identifier used by SQL Server when communicating with the client driver.
enlist_countintNumber of active requests in the session working on the transaction.
is_user_transactionbit1 = The transaction was initiated by a user request.

0 = System transaction.
is_localbit1 = Local transaction.

0 = Distributed transaction or an enlisted bound session transaction.
is_enlistedbit1 = Enlisted distributed transaction.

0 = Not an enlisted distributed transaction.
is_boundbit1 = The transaction is active on the session via bound sessions.

0 = The transaction is not active on the session via bound sessions.
open_transaction_countThe number of open transactions for each session.
pdw_node_idintApplies to: Azure SQL Data Warehouse, Parallel Data Warehouse

The identifier for the node that this distribution is on.

Requires VIEW SERVER STATE permission on the server.

Through bound sessions and distributed transactions, it is possible for a transaction to be running under more than one session. In such cases, sys.dm_tran_session_transactions will show multiple rows for the same transaction_id, one for each session under which the transaction is running.

By executing multiple requests in autocommit mode using multiple active result sets (MARS), it is possible to have more than one active transaction on a single session. In such cases, sys.dm_tran_session_transactions will show multiple rows for the same session_id, one for each transaction running under that session.

Dynamic Management Views and Functions (Transact-SQL)
Transaction Related Dynamic Management Views and Functions (Transact-SQL)

Community Additions

ADD
Show:
© 2016 Microsoft