Error:

Column ‘xxxxx’ is partitioning column of the index ‘PK_xxxxxxxx’. Partition columns for a unique index must be a subset of the index key.

Could not create constraint or index.

ALTER TABLE [dbo].[tbTable01] ADD CONSTRAINT PK_Table01 PRIMARY KEY CLUSTERED
    (
        biTable01Id
    )

Solution:

Since both biTable01Id, dtStartDateTime columns are in the partition column, both must be in the Primary Key column as well.

ALTER TABLE [dbo].[tbTable01] ADD CONSTRAINT PK_Table01 PRIMARY KEY CLUSTERED
    (
        biTable01Id, dtStartDateTime
    )
 
Last modified: October 22, 2020

Author

Comments

Write a Reply or Comment