Archiving heap tables

  • Hi,

    I've got a number of tables with no clustered index I want to archive on a regular basis (weekly). The only way I found to keep them from getting fragmented as well as to allow the space to be freed within the database is to create and then drop a clustered index each time after the archiving is done.

    Is there a more elegant way of doing this? Keeping the clustered index permanently is not an option at the moment.

    Thanks.

  • Without the clustered index, no.

    For the archiving of the heap tables - do you have a unique key or unique index on the table - could help with the archiving, but not with the defragmentation (a CI is needed for that).

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • If you upgrade to SQL Server 2008 - you can defragment HEAP tables. Other than that, you need to continue as you are now.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

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

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