• Update... I may have answered my own question but I haven't tried it, yet. I had previously rejected the idea of using just DBCC SHRINKFILE because the TRUNCATEONLY option doesn't seem to work well on the files of the very active PRIMARY file group and, of course, not using the TRUNCATEONLY option causes massive fragmentation. Since the files that I'd be rebuilding the Clustered Index on would not have any modifications or new inserts in progress, it might just work if I apply it immediately after each index rebuild on the small partition file.

    Still, if anyone has a better idea, I'd love to hear it. It would be, as my boss says, a "spec-hackular" idea.

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