Results 1 to 2 of 2

Thread: Help -- computed col vs. partition vs. unique key conflict...

  1. #1
    Join Date
    Mar 2003
    Posts
    383

    Help -- computed col vs. partition vs. unique key conflict...

    Hi:

    I have a customer table wiht customerID as PK clustered.

    I want to create partitioned table based on regionID.
    Since it did not work, I tried followings and it works in table creation

    PartCol as regionID * 1000 + customerID persisted
    ) ON PS_Schema_01 ([PartCol])

    However,
    Alter table [Customer] Add Constraint [PK_Customer] --PRIMARY KEY CLUSTERED/PRIMARY KEY NONCLUSTERED ([customerID] ASC) ON PS_Schema_01 ([PartCol])

    with error that
    --Msg 1908, Level 16, State 1, Line 1
    --Column 'PartCol' is partitioning column of the index 'PK_Z_CUST_ORDERSET'. Partition columns for a unique index must be a subset of the index key.

    Since this is the parent table, can't make regionID as part of the PK or Unique key since there are around 12 tables with FK associated with the customerID.

    Thanks in advance.
    David

  2. #2
    Join Date
    Mar 2003
    Posts
    383
    I got it. Both in SQL2005 and SQL2008, it is required that the partion column has to be the subset of that table's PK or UK, regardless wheather clustered or non-clustered.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •