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-6-2017 06:19 AM

transaction open state

@@TRANCOUNT

The nesting level of transactions. Each begin transaction in a batch increments the transaction count. When you query @@trancount in chained transaction mode, its value is never zero since the query automatically initiates a transaction.

Return type: int

transaction open 05-3-2016 02:24 AM

SQL

?????

Suman rawat 03-23-2015 12:45 AM

gg

Ggggg

abhishek 12-17-2014 11:10 PM

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