web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Synchronize database Error during upgrade

(0) ShareShare
ReportReport
Posted on by 2,259

I'm making data upgrade from AX 2009 to AX 2012 R3.

I went through the 'Data Upgrade Checklist' in AX 2012 R3,

the last step is to ' Synchronize database (Required) ', but I got the flowing errors description

SQL error description: [Microsoft][SQL Server Native Client 11.0][SQL Server]The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.VENDPACKINGSLIPJOUR' and the index name 'I_500SDHEADERIDX'. The duplicate key value is (5637144576, 0, maef).

SQL error description: [Microsoft][SQL Server Native Client 11.0][SQL Server]The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.DIRPARTYTABLE' and the index name 'I_041KEY'. The duplicate key value is (5637144576, <NULL>, 41).


can any one help me with that?

thanks a lot.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Perform the following steps:

    1. Truncate the table

    Run the below command

    truncate table tablename

    2. Restart AOS

    3.  Perform DB Synchronization.

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    Truncation of table means you are deleting data also for that table.

    In case of upgrade I believe data is important.

    By the way, your error message seems because of data duplication, which is violating primary index.

    Sometimes it happens in tables like batch table, where system has records of old system+new system creates its own records and result is what as you are receiving.

    There is something wrong with your data of VENDPACKINGSLIPJOUR

  • André Arnaud de Calavon Profile Picture
    301,109 Super User 2025 Season 2 on at

    Hi Wasim,

    I would not start truncating any table like Shaik mentioned. This could cripple your current database upgrade process.

    Did you had some customizations in AX2009 that are now different in AX2012?

    You have to find which records causes the duplicates. The error details provides you the table names and the record id's.

    The first issue is related to a SourceDocumentHeader relation in this table. Probably by accident AX issued a duplicate ID or the value is 0 for some records.

    Maybe the best is have a technical consultant onsite to help you out.

  • Suggested answer
    dekaasboer Profile Picture
    1,530 on at

    I know it is april fools day but truncating the data you want to upgrade is not really a solution.

    It seems that you have duplicate recid's. This can be corrected manually by assigning the next recid value from the SYSTEMSEQUENCES table. (is sorted by table identifier, not name)

    Please note that many things are joined together by recid. Carefully map the relationships of the recid you want to change in order to keep the database integrity.


    If you just want to complete the checklist and worry about solving your data integrity problems later you could temporarily disable the offending indexes in the AOT.

  • w.sallam Profile Picture
    2,259 on at

    thanks all for reply.

    I tried solutions biased on the ideas you gave.

    but still can't synchronize.

    the indexes 'I_500SDHEADERIDX' and 'I_041KEY' are not appearing in the 'VENDPACKINGSLIPJOUR' and 'DIRPARTYTABLE' tables.

    should I create it manually?

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    you should check your data inside SQL Server Management studio using query. Analyze it with respect to Current Unique key. You will find current key in AOT>>Tables>>YourTable>>Indexes. take index which is defined as primary or alternative in table properties

  • w.sallam Profile Picture
    2,259 on at

    as I'm in the synchronize phase I can't open AOT in AX,

    I check the tables in SQL Server

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    On AX2012R3 the Primary key for VENDPACKINGSLIPJOUR (Table) is a composite primary key which is based on following two columns

    SourceDocumentHeader

    RecId

    Whereas on AX2009 the primary index for this table is RecId

    In AX 2009, SourceDocumentHeader and SourceDocumnetLine tables do not exist.

    So I doubt it a case where system is trying to synch before, where data is same as of AX2009

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    following URL is almost very clear indication of your issue.

    msdn.microsoft.com/.../jj719039.aspx

    it's the issue of synchronization prior to Preprocessing Data Upgrade Scripts for Microsoft Dynamics AX 2012

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans