Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Transaction Error: Msg 266

Author  Topic 

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2008-09-25 : 19:01:14
Hello,
am having problems with a SP. I have appears the script has locked a certain table, which I cant seem to have access to.

I was running a transaction using begin transaction @tran; and commit transaction @tran;

I have corrected the bug, But how do i free the resources and get access to the table ?

thanks
Ehi


ERROR MESSAGE:


Msg 266, Level 16, State 2, Procedure Msg_billing, Line 0
Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 0, current count = 1.

clarkbaker1964
Constraint Violating Yak Guru

428 Posts

Posted - 2008-09-26 : 01:01:56
if you have the same connection open just issue a rollback,
otherwise kill the connection with the open tran.
you can run dbcc opentran and sp_who to find the spid for the kill command.
The transaction will rollback when the spid gets killed.

You can do anything at www.zombo.com
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2008-09-27 : 10:50:34
Ok thanks.

I also noticed if i shut down Management studio, it kills the process.
Go to Top of Page
   

- Advertisement -