Remove table partitioning

  • Hi all,

    Just wanted to check something out if I may, we have a table (call it TableA) that is 29GB in size, its currently split over a number of partitions, I need to remove the partitioning and I wanted to check to see if there was another/easy way to do this, as of now my plan is;

    1. Script the FK's, indexes etc for the table (TableA)
    2. Create a new table called TableA_tmp  with no partition
    3. Copy all the data from TableA to TableA_tmp
    4. Drop TableA (this will involve dropping the scripted FK's)
    5. Rename TableA_tmp to be TableA
    6. Re-add all the Fk's,indexes etc
    7. Drop the partition function and scheme as they will no longer be used,

    So what do you think? does my plan sound about right or is there an easier way of doing this?

    Thanks,

    Nic

  • Drop all the non-clustered indexes then re-create the clustered index with the DROP EXISTING option and use the FILEGROUP name instead of the partition scheme name, and then re-create the non-clustered indexes.

    Restore a copy of the database somewhere you can test first.

     

  • Hi,

    Thanks for this, all work nicely.

    Nic

  • This was removed by the editor as SPAM

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

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