• chilidogie (10/16/2012)


    We have a database with lab tests that we are going to merge with a different database. The original has 8,000,000 records. The new one can only bring in 100,000 at a time. I am copying the database, then deleting down to 100,000 records. However, the space on disk remains the same. Do I need to pack the database somehow to regain the space ?

    Thanx !

    Yes. Rebuild the clustered index to recover the table space and rebuild the non-clustered indexes to regain the index space.

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