switch table to partition

  • Hi,

    I have little problem with switch table to partition

    when i try :

    ALTER TABLE my_table_tmp SWITCH TO my_table PARTITION 1

    (just before i switched partition to this table)

    i get error :

    ALTER TABLE SWITCH statement failed. Check constraints of source table 'my_table_tmp' allow values that are not allowed by range defined by partition 1 on target table 'my_table'

  • Hi

    staging table should have the same check constraints as the production tabble.

    "Keep Trying"

  • ok

    I resolve the problem, (i dont have any constraints ) but I had to add new one to table_tmp and then switch table

  • Check for the article on data partitioning in the link given below.

    http://www.sql-articles.com

    Cheers,
    Sugeshkumar Rajendran
    SQL Server MVP
    http://sugeshkr.blogspot.com

  • tklimczak - Tuesday, November 13, 2007 4:38 AM

    ok I resolve the problem, (i dont have any constraints ) but I had to add new one to table_tmp and then switch table

    What Constraint you added to your staging table

  • Sugesh Kumar - Tuesday, November 13, 2007 11:23 PM

    Check for the article on data partitioning in the link given below.http://www.sql-articles.com

    Do you have a more specific link to an article on partitioning rather than a generic pointer to some blog?

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

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

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