07 June 2013

AX2012 Export / Import Error

When the following error occurs during data import via DAT/DEF then the following could help:

Cannot execute the required database operation. The SQL database has issued an error.
An error occured during data import

First of all this message does not tell where the error came from. So I checked the error log of the SQL Server and found this message:

Object Server 03: The database reported (session 3 ()): [Microsoft][SQL Server Native Client 10.0][SQL Server]Invalid object name 'DBO.[AX2012_model] .[dbo].SECURITYROLE'.. The SQL statement was: "UPDATE "DBO"."T073473B435914AF595C2B7075BD5D7D6" SET "CONFLICTS" = 1, "NEWRECID" = "DBO".SYSOLD2NEWRECID.IDREF FROM "DBO"."[AX2012_model].[dbo].SECURITYROLE","DBO".SYSOLD2NEWRECID WHERE "DBO"."T073473B435914AF595C2B7075BD5D7D6"."CONFLICTS" = 0 AND "DBO"."T073473B435914AF595C2B7075BD5D7D6".RECID = "DBO".SYSOLD2NEWRECID.ID AND "DBO"."[AX2012_model].[dbo].SECURITYROLE".RECID = "DBO".SYSOLD2NEWRECID.IDREF AND "DBO".SYSOLD2NEWRECID.TABLEREF = 65491 AND "DBO".SYSOLD2NEWRECID.SOURCEGUID = '{F20E9748-9070-4138-8546-38B382154E08}' AND "DBO".SYSOLD2NEWRECID.TARGETVIRTUALCOMPANY = '""' AND "DBO".SYSOLD2NEWRECID.PARTITION = 5637144576"

This message indicates that there is a problem with the table SecurityRole. So I tried to find out why the system want's to import records from this table even though it was not included in the tablegroup. After exporting into a comma seperated file i could find records with this table in the exported DAT File. Searching for the RecID of these records I found a refernce from the DirExternalRole table.

After removing this Table from the tableGroup I exported the data again and nowthe import is not throwing this error anymore :)