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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

DirPartyTable synchronization error

(0) ShareShare
ReportReport
Posted on by

Dear All,

Every time I synchronize database, I get these error message:

  • Cannot execute the required database operation. The SQL database has issued an error.

  • SQL error description: [Microsoft][SQL Server Native Client 11.0][SQL Server]Implicit conversion from data type datetime to int is not allowed. Use the CONVERT function to run this query.
  • SQL statement: INSERT INTO X2303X SELECT NAME,LANGUAGEID,NAMEALIAS,BUSINESSACTIVITY_SA, . .(bla bla bla) . . , RELATIONTYPE,PARTITION,RECID FROM DIRPARTYTABLE
  • Problems during SQL data dictionary synchronization. The operation failed.

  • Synchronize failed on 1 table(s)

It looks like my DirPartyTable can't be synced for some reason. Is there any idea, how do I solve this?

Thank you for your time,

Regards,

Fauzan Azhiman

Junior AX Developer at Astragraphia Information Technology



*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    239,647 Most Valuable Professional on at

    It looks like broken field IDs. Didn't you copy the database from another environment, for example?

  • Suggested answer
    Community Member Profile Picture
    on at

    Fauzan Azhiman

    i suggest you that please compile the dynamics ax again and then synchronize.

  • Community Member Profile Picture
    on at

    Hi Martin,

    Thank you for your response.

    We did copy the databases from development environment to testing & production environment.

  • Suggested answer
    Martin Dráb Profile Picture
    239,647 Most Valuable Professional on at

    I would dispute the whole idea of copying a development database to production, nevertheless the key problem is that you must use a compatible AX (OLTP) database and modelstore database, because they must use the same IDs. If you just take a database from another environment, IDs won't match and the whole thing will blow up. You could move both databases together, nevertheless I think that you should review your whole strategy.

    I also suggest you read Deploying Customizations Across Microsoft Dynamics AX 2012 Environments.

  • Community Member Profile Picture
    on at

    Hi Martin,

    We didn't just copy the AX database, we copied both AX transaction database and modelstore database together.

  • Community Member Profile Picture
    on at

    Hi Parth,

    Thank you for your suggestion. I'll try your suggestion.

  • Martin Dráb Profile Picture
    239,647 Most Valuable Professional on at

    Well, if you really have a changed ID, obviously something wasn't done correctly. Please make sure that you review your process; I can't comment on it further without more information.

  • Community Member Profile Picture
    on at

    Martin,

    Thank you. We will check and find out. This is so weird because this error only happen with DirPartyTable.

  • Community Member Profile Picture
    on at

    I have the same problem.

    How do you solve it in the end

  • Community Member Profile Picture
    on at

    Hi all,

    Sorry, I forget to update. We had already found out how to solve this issue.

    First, we did some troubleshooting by using SQL Server Profiler to trace the executed SQL transactions when DirPartyTable synchronization occurs, and then we found out these 2 statements:

     CREATE TABLE "DBO".X2303X  (BUSINESSACTIVITY_SA NVARCHAR(10) DEFAULT NULL ,BUSINESSACTIVITYDESC_SA NVARCHAR(60) DEFAULT NULL ,FILENUMBER_SA NVARCHAR(15) DEFAULT NULL ,COMPANYNAFCODE BIGINT DEFAULT NULL , .......  (very long statement) ............ L CHECK (RECID <> 0) )

    INSERT INTO X2303X SELECT NAME,LANGUAGEID,NAMEALIAS,BUSINESSACTIVITY_SA,BUSINESSACTIVITYDESC_SA,FILENUMBER_SA,COMPANYNAFCODE,BUSINESSNUMBER_CA,SOFTWAREIDENTIFICATIONCODE_CA,FISCALCODE_IT,COMPANYTYPE_MX,RFC_MX,CURP_MX, ............  (very long statement) ...... RECVERSION,RELATIONTYPE,PARTITION,RECID FROM DIRPARTYTABLE

    We found that when the synchronization occurs, AX tried to create a temporary table called "X2303X" and then copy the all contents of DirPartyTable to X2303X table using INSERT INTO .... SELECT statement. The problem is, the column order in the CREATE statement didn't same as the column order in the INSERT INTO SELECT statement. It's so right, that what Martin said, there are some field id mismatch that cause the column order is different.

    So, these are steps what we did to solve this (but this is a little bit tricky and risky, and I'm not sure these will be working on different environment):

    1. Backup transaction & model database. We don't want to something bad happens.
    2. Script the DirPartyTable content using SQL Management Studio (it will generate INSERT statements to insert the table content).
    3. DROP the DirPartyTable table.
    4. Synhronize DirPartyTable from AOT. A new DirPartyTable will be create physically in the transaction database.
    5. Execute the INSERT statements that are generated in step 2, to fill the new DirPartyTable.
    6. Synchronize the whole database, restart AOS.

    After this, our Dynamics AX runs normally and the synchronization error is gone.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 24

#2
Michel ROY Profile Picture

Michel ROY 14

#3
Jagadabi Profile Picture

Jagadabi 6

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans