Author |
Topic |
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-02-26 : 03:05:57
|
Hi, Please help me to resolve this issue...We have Triggers and also some procedures.... We are calling some procedures inside a procedure...Somewhere it is causing this error:Please let me know the fix for this issueMsg 266 Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 1, current count = 0.--Chandu |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-02-26 : 03:17:57
|
i think you've not included the logic in inner procedures to rollback transaction upon all possible error condition. If over 2005 put TRY CATCH around the logic------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-02-26 : 03:42:38
|
Yes we have included TRY..CATCH in each Procedure.... --Chandu |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-02-26 : 03:45:17
|
and have you added code to ROLLBACK inside CATCH block the open transactions------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-02-26 : 03:49:52
|
we just removed all BEGIN TRAN statements inside procedures...They have added that TRAN code from front-end now....Then also same problem raising.....--Chandu |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-02-26 : 22:33:56
|
hmm..I've seen the above message mostly in cases where transaction were not closed (commit/rollback) properly------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-02-27 : 00:29:54
|
we just removed all BEGIN TRAN statements inside procedures...They have added that TRAN code from front-end now....This is working fine now...--Chandu |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-02-27 : 00:31:44
|
ok...i assume the issue might have been with nesting of transactions inside procedures------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-02-28 : 09:14:53
|
May be... I want to know the usage of BEGIN TRAN.. COMMIT/ROLLBACK functionalities..Share me links for that..Thank u--Chandu |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-02-28 : 09:55:26
|
quote: Originally posted by bandi May be... I want to know the usage of BEGIN TRAN.. COMMIT/ROLLBACK functionalities..Share me links for that..Thank u--Chandu
Look into books online------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-03-01 : 07:38:37
|
quote: Originally posted by bandi May be... I want to know the usage of BEGIN TRAN.. COMMIT/ROLLBACK functionalities..Share me links for that..Thank u--Chandu
What I routinely use are the two examples (b) and (c) - mostly (c) - on this page: http://msdn.microsoft.com/en-us/library/ms175976.aspx |
|
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-03-01 : 08:29:12
|
quote: Originally posted by James K
Thank you James--Chandu |
|
|
|