Which global variables can be used to determine if a transaction is still open?

Options
- @@NESTLEVEL
- @@FETCH_STATUS
- @@TRANCOUNT
- @@CONNECTIONS


CORRECT ANSWER : @@TRANCOUNT

Discussion Board
@@TRANCOUNT

The @@TRANCOUNT is used to determine whenever a transaction is still open. It returns the number of active transactions for the current connection. It increments the count value whenever we open a transaction and decrements the count whenever we commit the transaction. Rollback sets the trancount to zero and transaction with save point does to affect the trancount value. It helps application to keep track of the open transactions.

Prajakta Pandit 03-9-2017 06:31 AM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement