Free Disk Space by Clearing Columns ?

  • I have a huge archive table in a lightly used archive database. We really don't need all the data in each row, and I was considering updating a lot of columns to NULL. Will that free up space for reuse, either with or without shrinking the database file ? I don't want to actually drop the unneeded columns because I might break applications that populate & use the table, but I would like to reclaim space.

    (SQL 2008 R0, std ed.)

  • You'll definitely need to rebuild the clustered index to release the free space into the data file for reuse by other tables, may need to run DBCC CleanTable as well

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • I also believe that type of thing will only work on variable length columns, as well.

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

  • You might want to consider table/index compression.

    Edit: Sorry did not notice it was standard edition. Data compression not available

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply