This particular code is a bit too complcated. What exactly you're trying to do and is it possible to avoid cursors (performers killers) at all for your task?
>Ok, that helped with another issue I was having, but it still doesn't keep the query from hanging up.
>
If it's not broken, fix it until it is.
My Blog