Search code examples
axaptadynamics-ax-2012dynamics-ax-2012-r3

Table synchronize error. Cannot drop the index because it does not exist or you do not have permission


I added a field to this table: STG_INVOICE_SUP_VW

But then I wasn't able to synchronize the table so I deleted it. Now if I'm trying to synchronize any table it's throwing this error below:

Cannot execute a data definition language command on (). The SQL database has issued an error.

SQL error description: [Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the index 'STG_INVOICE_SUP_VW._dta_index_STG_INVOICE_SUP_VW_25_692157136__K7_1_2_3_4_5_6_8_9_10_11_12_13_14_15_16_17_1', because it does not exist or you do not have permission.

SQL statement: DROP INDEX STG_INVOICE_SUP_VW._dta_index_STG_INVOICE_SUP_VW_25_692157136__K7_1_2_3_4_5_6_8_9_10_11_12_13_14_15_16_17_1

Problems during SQL data dictionary synchronization. The operation failed.

Synchronize failed on 1 table(s)

enter image description here


Solution

  • Edit:

    Entire issue was related to an additional index created from SQL side. If you create an Index on AX tables from SQL side then either you won't be able to synchronize the table or your created index will be dropped on synchronization(as suggested by by some users).
    You should create indexes from Application Object Tree.

    I Deleted the index from SSMS and then synchronize worked perfectly.

    It also solved one more issue. Incremental CIL was throwing an error below:

    Cannot create a record in SysXppAssembly (SysXppAssembly). The record already exists.

    For incremental CIL issue I had already done the steps pointed here but it didn't fix it:

    1. Stop the AOS Navigate to the XppIL folder in your AOS server “C:\Program Files\Microsoft Dynamics AX\60\Server\YourAXInstanceName\bin\XppIL”
    2. Backup the files from the XppIL folder.
    3. Delete the files from the XppIL folder. Note: files only not sub folders.
    4. Restart the AOS.
    5. The XppIL folder files will be created after the AOS restart

    From this link: Community.Dynamics

    After fixing the table sync issue, Incremental CIL ran without issue.