Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'm not sure if these will work in Compact Edition 3.5, but this what other editions of SQL Server use:</p> <p><strong>XACT_STATE()</strong> reports the transaction state of a session, indicating whether or not the session has an active transaction, and whether or not the transaction is capable of being committed. It returns three values: </p> <ul> <li>1, The session has an active transaction. The session can perform any actions, including writing data and committing the transaction. </li> <li>0, There is no transaction active for the session. </li> <li>-1, The session has an active transaction, but an error has occurred that has caused the transaction to be classified as an uncommittable transaction. The session cannot commit the transaction or roll back to a savepoint; it can only request a full rollback of the transaction. The session cannot perform any write operations until it rolls back the transaction. The session can only perform read operations until it rolls back the transaction. After the transaction has been rolled back, the session can perform both read and write operations and can begin a new transaction.</li> </ul> <p><strong>@@TRANCOUNT</strong> Returns the number of active transactions for the current connection. </p> <ul> <li>0, not in a transaction </li> <li>1, in a transaction</li> <li>n, in a nested transaction</li> </ul> <p><strong>EDIT</strong> base don OP's comments Try this query:</p> <pre><code>SELECT * FROM sys.dm_tran_session_transactions WHERE session_id=@@SPID </code></pre> <p>or this to get more info:</p> <pre><code>SELECT * FROM sys.dm_tran_session_transactions s INNER JOIN sys.dm_tran_active_transactions a On s.transaction_id=a.transaction_id WHERE s.session_id=@@SPID </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload