• ramana3327 (8/27/2014)


    Yes.

    The problem is that tables have foreign key constraints. We don't have any proper partition key. So now we created two additional columns on those tables created date & Updated date. These two columns automatically populates with triggers inserted data & updated data and for previous we use the dummy data.

    Now we decided to partition those tables and take create-date as partition key.

    We want to do partition that one partition holds current year data all the time and another partition holds previous year data and last partition holds all the historical data.

    I do have 1 doubt about this

    If the table has Primary key on ID1 column and has the clustered Index also it is child table to another table by using ID2 column. If I want to do partition on created date. How can I do?

    I am thinking that

    First I need to disable that primary key and foreign key constraints and then do the partition then created clustered index on create date and make the id column as primary but creates make that it creates non-clustered index then recreate the foreign keys.

    Thanks,

    Let me get this straight - you added TWO columns, likely 16 bytes for full date time, AND added triggers to populate them (why not populate them with whatever does the INSERT/DELETE??), JUST so you could implement partitioning to make your stuff run faster?? Zowie - I am just speechless! :blink:

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service