• Since I've worked on both, I can give you some very good tips...

    Step 1. Relax... SQL Server doesn't require things like Reference Cursors to return a result set. A simple SELECT will do it.

    Step 2A. Forget everything you know about Cursors and While Loops. 99.9% of everything that can be done, can be done without either and will run MUCH faster in the process.

    Step 2B. Make a mental paradigm shift (like my signature line says below)... stop thinking about what you want to do to a row and start thinking about what you want to do to a column.

    Step 3. Break out Books OnLine (the help system in SQL Server). Read about every function and read about the double FROM clauses in UPDATE... they will save your bacon. Forget about using correlated subqueries in UPDATE and learn that UPDATE and SELECT can use the same kinds of joins.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)