• Since this is SQL Server 2008, you can't rebuild a partitioned table (implied by the "Partition = ALL") and this table will be unavailable during the rebuild of all the indexes.

    On the SORT IN TEMPDB thing... It'll only affect TEMPDB by 10 or 20% of what the largest index is. If THATs a problem, then you need to stop an make sure you have enough room for that in TEMPDB. If you decide to not sort in TEMPDB, then you need to make sure that the database the table lives in has enough room to grow.

    If you're operating in the FULL recovery mode, this will NOT be a minimally logged operation and you need to make sure that you have enough log file space.

    Of course, I'm basing all of the file size worries on the fact that you have "Partition = ALL" in the code so I'm assuming that it's a fairly large paritioned table.

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