SQL Partitioning on existing tables

  • Hi Guys,

    I would like to implement SQL partitioning on an existing table in my database. Can someone please assist? I want to create partitions for every month. The articles on google only explains how to create a partition and to create a table as well but does not explain how to do it with an existing table.

    Any advice would be appreciated.

    Regards

    IC

  • Basically, you just have to move the indexes.

    Take a look at this article by Martin Bell, I think you will find enlightening.

    Hope this helps

    Gianluca

    -- Gianluca Sartori

  • It is quite possible and easy task. Basically you need to first decide on what column ( date ) you need to do the partition on your existing table. You also need to map indexes for same. If you looking something like sliding windows scnerio in your partion then below is the document.

    http://www.sqlskills.com/resources/whitepapers/partitioning%20in%20sql%20server%202005%20beta%20ii.htm

  • Gianluca Sartori (5/5/2010)


    Basically, you just have to move the indexes.

    Clustered!!

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Rebuilding the clustered index into the partition scheme will move the whole table data into the partition scheme.

    To keep nonclustered indexes aligned, they also have to be partitioned, at least including the partitioning key fields.

    -- Gianluca Sartori

  • Thanks...I found this link very helpful.

Viewing 6 posts - 1 through 5 (of 5 total)

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