June 12, 2008 at 5:34 am
Really weird issue. Someone may have come across this before...
I run a batch of sql code. I actually see that it gets to the final step and then finishes. But it leaves a lock on the table that I have to kill. The job is finished, but is showing as sleeping on an sp_who2.
Anyone seen this behaviour before?
June 12, 2008 at 8:00 am
There are very few reasons why this may happen...
--Uncommitted transaction
Do a transaction count at the end of the proc to find out. Might take a bit to find if your code is heavy RBAR with lot's of calls.
--Improperly closed object
Did you leave a scrollable cursor open? Did you use an sp_OA* sproc and forget to close an object?
--Jeff Moden
Change is inevitable... Change for the better is not.
June 12, 2008 at 8:52 am
COMMIT had been commented out! :crazy:
Thanks
June 12, 2008 at 2:19 pm
That's a common mistake that many developers make... they comment something like that out so they can test and do a rollback... but they forget to put things back the way the were. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply