• I don't think you will get any useful replies this way. Many things are missing.

    You're not saying which tables are involved and what they look like, and, first of all, you're not saying what you're after.

    Your code does lots of calls to other stored procedures, but you didn't include the code.

    I suggest that you cut down this code into pieces and try to get rid of the cursors, using set-based code instead.

    If you want advice on how to go down that road, don't simply post your code and wait for us to tune it for you. You'd better find the most problematic part of the procedure and ask for help on how to turn it into set based updates.

    You may find useful taking a look at the article linked in my signature.

    -- Gianluca Sartori