Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

How can I fix this error

Posted on by 1,970

We went live with the HITB at the end of June. Both the detail and the summary reports ran perfectly for June and July. At the end of August, I noticed that the summary report wouldn't run. It gives this error message:  [Microsoft] [SQL Native Client] [SQL Server] Violation of PRIMARY KEY constraint 'PK##0422252'. Cannot insert duplicate key in object 'dbo.##0422252'.

I tried running the report each day in August and found that the error starts August 5. I looked for duplicate entries on August 5 and didn't find any. I did find that we did a standard cost revaluation on this day though, and I changed the inventory account number before posting the revaulation entry. I also changed the inventory account number on the item card. I'm wondering if this change I made after the revaluation was done but before it was posted is causing the error. I corresponded with a consultant we use, and she didn't think this would cause the error and suggested checking links. I've checked links on sales work and history; purchasing history and transactions; and inventory  bill of materials transaction history, bill of materials transactions, inventory control, inventory landed cost cards, inventory purchase receipts, inventory transaction work, and stock count history. I didn't see a way to check links on inventory transaction history.

Does anyone have any suggestions on this? I'm still able to run a summary smartlist on the data in the table but I can't run a summary HITB report for any day August 5 or after. I can't help but think that it's due to the change I made on August 5 before posting the revaluation entry, but I don't know how to check that.

*This post is locked for comments

  • Annmarie Teehan Profile Picture
    Annmarie Teehan 45 on at
    RE: How can I fix this error

    Hi Francisco,

    I am getting this same error message. Can you detail how you removed the PK## Keys please?

    Regards,

    Annmarie.

  • Suggested answer
    Richard Whaley Profile Picture
    Richard Whaley 25,195 on at
    Re: How can I fix this error

    Did you try running CheckLinks?

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: How can I fix this error

    I did had this problem before and it turns out that for my environment the PK## keys were not valid

    I removed them all and my system worked fine with no problems as of today.

    The correct keys i believe should not contain the ## symbols

    try this solution after a backup has been done of your DB and let us know

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: How can I fix this error

    I having this same problem:

    I am trying to pull a inventory activity report through reports->inventory->historical IV trial balance and on a certatin day and certain location code i keep getting violation of primary key constraint pk##xxx cannot insert duplicate key in object dbo.##xxx

    I’m only having trouble with one day.

    Did you ever get a resolution to your problem

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