Error: Could not create constraint

  • I all,

    I've got the following message: 'HR_Payout' table

    - Unable to create index 'PK_FACT_HR_Payout'.

    The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.FACT_HR_Payout' and the index name 'PK_FACT_HR_Payout'. The duplicate key value is (32, 200901).

    Could not create constraint. See previous errors.

    The statement has been terminated.

    Does anyone know how to the problem?

    Thanks

  • the errors pretty clear.

    you are trying to create a unique primary key on an existing data. but at least one combination of those two columns are not unique. the values (32, 200901).

    , but dunno the column names

    you'll need to either clean up the data, or maybe find a combination of say, 3 columns of data instead of two tha makes it REALLY unique...it depends on your data and biz rules.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Hi Lowell,

    It was a dupplicate data in source table. Thank you for your help.

Viewing 3 posts - 1 through 2 (of 2 total)

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