NUMBER OF ACTIVE TRANSACTIONS
@@TRANCOUNT shows # of active transactions for the current connection
Select @@TRANCOUNT
If you use savepoint_name in ROLLBACK TRANSACTION @@TRANCOUNT will not be affected
Begin
Begin Transaction
Save TRAN Point1 ;
Select 'The Transaction Count is ' + cast(@@TRANCOUNT as varchar) ;
-- This roll Back will not have any impact on @@TRANCOUNT
RollBack Transaction Point1
Select 'The Transaction Count is ' + cast(@@TRANCOUNT as varchar) ;
-- This roll Back will Reset the @@TRANCOUNT
RollBack Transaction
Select 'The Transaction Count is ' + cast(@@TRANCOUNT as varchar) ;
End
Keywords: @@TRANCOUNT, savepoint_name, Number Of Active Transactions
Showing posts with label Number Of Active Transactions. Show all posts
Showing posts with label Number Of Active Transactions. Show all posts
Friday, April 27, 2007
Subscribe to:
Posts (Atom)