@@trancount problem
-
hi, why after execution of 'begin transaction' the @@trancount=2(original value is 0)? thanks!
-
hi, why after execution of 'begin transaction' the @@trancount=2(original value is 0)? thanks!
When ever a transaction is initiated the @@trancount increases by 1. when a rollback is issued (Even with in nested transaction) the value reset to 0. i am not sure what happens during commit trans (may be it decremented by 1) Cheers, Venkatraman Kalyanam Bangalore - India Reality bites: I am reality
-
When ever a transaction is initiated the @@trancount increases by 1. when a rollback is issued (Even with in nested transaction) the value reset to 0. i am not sure what happens during commit trans (may be it decremented by 1) Cheers, Venkatraman Kalyanam Bangalore - India Reality bites: I am reality
yes,commit trans decremented by 1,but after this command ,the @@trancount is 1,not 0,the problem is what makes the strange,the @@trancount incremented by 2?
-
yes,commit trans decremented by 1,but after this command ,the @@trancount is 1,not 0,the problem is what makes the strange,the @@trancount incremented by 2?
william_zhou wrote: the problem is what makes the strange,the @@trancount incremented by 2? Do you work in Implicit Transactions mode which may be causing this effect ?
-
william_zhou wrote: the problem is what makes the strange,the @@trancount incremented by 2? Do you work in Implicit Transactions mode which may be causing this effect ?
no,i assure i had not used this mode
-
william_zhou wrote: the problem is what makes the strange,the @@trancount incremented by 2? Do you work in Implicit Transactions mode which may be causing this effect ?
oh,i'm sorry, i did work in Implicit Transactions mode,but this mode was not setted by me, now how can i cancel this mode
-
oh,i'm sorry, i did work in Implicit Transactions mode,but this mode was not setted by me, now how can i cancel this mode
SET IMPLICIT_TRANSACTIONS OFF
good luck:) -
SET IMPLICIT_TRANSACTIONS OFF
good luck:)thanks, but a new problem appears,when i call this proc in my embeded c sql,the return value is -266,which is the same problem @@trancount,i am nearly insane for this bad luck,why?
-
SET IMPLICIT_TRANSACTIONS OFF
good luck:)i set implicit_transactions off at the beginning of the proc,such as: 'alter proc sp_myproc @i_input as set implicit_transactions declare @tmp int ... ' but when i debug it,i find behind the 'set implicit_transactions' is a strange message:'set implicit_transactions on',now who active this event,why can it happen?
-
i set implicit_transactions off at the beginning of the proc,such as: 'alter proc sp_myproc @i_input as set implicit_transactions declare @tmp int ... ' but when i debug it,i find behind the 'set implicit_transactions' is a strange message:'set implicit_transactions on',now who active this event,why can it happen?
use
SET IMPLICIT_TRANSACTIONS OFF
before beginning any transactions not inside a transaction. then start the transaction explicitly usingBEGIN TRAN