• Have an old app that imports data into a MSSQL server DB using an ODBC connection.

    To be honest, because of the CID=1 thing, all of the solutions so far look like RBAR to me. Also, because a lot of "developers" to a cursory insert and then an update just to insert one row, I usually do inserts first and then updates.

    You say that you have an old app that imports the data but you don't say from where or how. It think it's time to spill the beans on that subject because none of this is looking set-based so far.

    --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)