• You might also want to look into Trace Flags 1117 and 1118.

    http://www.brentozar.com/archive/2014/06/trace-flags-1117-1118-tempdb-configuration/

    http://www.sqlskills.com/blogs/paul/misconceptions-around-tf-1118/

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