• OK? What's the problem and/or question?

    You've got a cursor. It looks like it's doing updates.

    It's hard to comment in any other way without knowing what you're trying to do and what the problem is.

    Just so you know, more often than not, using a cursor is not the best way to solve most TSQL problems. I'm not sure what's going on here, but based on the little I can see, I suspect you don't need the cursor.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning