Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Violation of PRIMARY KEY constraint ‘PKCM20100’. Cannot insert duplicate key in object ‘dbo.CM20100’.

Posted on by Microsoft Employee

Violation of PRIMARY KEY constraint ‘PKCM20100’. Cannot insert duplicate key in object ‘dbo.CM20100’.

*This post is locked for comments

  • 26P2ER Profile Picture
    26P2ER 1,773 on at
    RE: Violation of PRIMARY KEY constraint ‘PKCM20100’. Cannot insert duplicate key in object ‘dbo.CM20100’.

    I am not even pretending I know more than Leslie but Sandip had a smiler issue answered. It had to with skipped identity column values and updating the same. Cm40102 is the the table that is in play here

    Here is the link.

    community.dynamics.com/.../222976

  • Verified answer
    L Vail Profile Picture
    L Vail 65,271 on at
    RE: Violation of PRIMARY KEY constraint ‘PKCM20100’. Cannot insert duplicate key in object ‘dbo.CM20100’.

    DynamicsDev brings out a good point. The duplicate wouldn't already exist in the target table. That is the problem, you are trying to insert a duplicate record. If you look at the fields

    CMDNUMWK

    VOIDED

    of the document you are trying to insert, you should find that one already exists in the table. Time will not fix this kind of error. The 'same order' must have one of the fields different. I suspect it is the Voided field.

    Kind regards,

    leslie

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Violation of PRIMARY KEY constraint ‘PKCM20100’. Cannot insert duplicate key in object ‘dbo.CM20100’.

    The error is saying it was trying to insert duplicate records into the table. Not that there are duplicate records in the table already.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Violation of PRIMARY KEY constraint ‘PKCM20100’. Cannot insert duplicate key in object ‘dbo.CM20100’.

    Hi Vail

    Thanks for your reply,

    But in that table there is no duplicate records and still i'm getting the same issue.

    and if i place same order after some time it was working fine without any issue.

    I Hope you will help me out !

  • Verified answer
    L Vail Profile Picture
    L Vail 65,271 on at
    RE: Violation of PRIMARY KEY constraint ‘PKCM20100’. Cannot insert duplicate key in object ‘dbo.CM20100’.

    Mallesh,

    The Primary Key for table CM20100 contains 2 columns:

    CMDNUMWK

    VOIDED

    This error message is telling you that a record already exists in the table that matches the key of the record you are trying to insert. Run a query against the CM20100 and then you'll find the document. It has been my experience that Primary Key errors are never wrong.

    Kind regards,

    Leslie

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Violation of PRIMARY KEY constraint ‘PKCM20100’. Cannot insert duplicate key in object ‘dbo.CM20100’.

    I did n't get you RogetRogerATX

  • RogerRogerATX Profile Picture
    RogerRogerATX 1,515 on at
    RE: Violation of PRIMARY KEY constraint ‘PKCM20100’. Cannot insert duplicate key in object ‘dbo.CM20100’.

    Run checklinks first, but this will happen if you have the same record in both the work and open tables.....

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans