• There's one other thing that you might actually want to add to the proc if it's ever used by ccalls from the front end.

    SET NOCOUNT ON;

    That will keep the rowcounts from being created and returned to the GUI as a possible result set which, may in turn, be looked at as some kind of error. If nothing else, it saves some clock cycles and maybe a little I/O traffic.

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