Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

AA violation of primary key constraint/cannot insert duplicate key in object

Posted on by 6,775

 

When trying to upload an AA budget, the following error displays "Unhandled object exception:  Violation of PRIMARY KEY constraint '___.' Cannot insert duplicate key in object "

 

 

I checked this kb article but the resolution / workaround #2 does not return values. The script may be out of date; SQL Version is SQL Server 2008 

http://support.microsoft.com/kb/897280

*This post is locked for comments

  • Re: AA violation of primary key constraint/cannot insert duplicate key in object

    Table AAG00905

    This table stores the Budget Tree Account Balance. It already sees a value in this table that you are trying to import, so it is returning a duplicate record error. The primary keys on this table are: aaBudgetID, aaCodeSequence, ACTINDX, aaFiscalPeriod, aaActualPriliminary.  

    Typically to resolve, make sure you don't have the same code and account combination listed more than once within each level.  

  • Renee Leung Profile Picture
    Renee Leung 6,775 on at
    Re: AA violation of primary key constraint/cannot insert duplicate key in object

    Yes it is referencing a duplicate key for AAG00905. I updated the field in SQL based on this KB article support.microsoft.com/.../897280 but it did not resolve the error. Could you expand on the AAG00905 error, Cheryl? We checked multiple times in the budget, but it looks fine to us. Thanks!

  • Re: AA violation of primary key constraint/cannot insert duplicate key in object

    Does the error reference a table at all?   Usually it does and then you can see what table it is having issues with.  I have seen this happen before, and if a duplicate key on the AAG00905 is from having an account in the budget that does not exist.  An error on the AAG00904 may be due to having imported in AA dimension codes and the AAG00401 has duplicate codes....so it could be from a number of reasons.  Seeing the whole error message will give a better indication of what the issue is.

  • Renee Leung Profile Picture
    Renee Leung 6,775 on at
    Re: AA violation of primary key constraint/cannot insert duplicate key in object

    Yes we checked for duplicates and did not see any. The same error message appears at the point where budget upload is 'waiting for SQL Server'

  • Verified answer
    Richard Whaley Profile Picture
    Richard Whaley 25,195 on at
    Re: AA violation of primary key constraint/cannot insert duplicate key in object

    check your source file for lines with duplicates of the following fields:

    Budget ID + Code Sequence + Account +Period Date + Fiscal Period

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,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans