Resolve Duplicate Key Row in Object 'dbo.ModelElement' with Unique Index 'I_ModelElement_Id1Id2'

Im getting the error while installing Patch.

Update model details metadata not available.

Following files will be imported as part of this update: D:\AX_GST_Update\Microsoft Dynamics India GST AX 2012 R2 GA release\AX2012R2KB4019353\DynamicsAX2012R2-KB4019353-App\Models\dynamicsax2012r2-kb4019353-foundation.axmodel, D:\AX_GST_Update\Microsoft Dynamics India GST AX 2012 R2 GA release\AX2012R2KB4019353\DynamicsAX2012R2-KB4019353-App\Models\dynamicsax2012r2-kb4019353-syplabels.axmodel.

Using AxUtil to connect to database “MSDynamicsAXCRM_model” on server “WIN-TST2254”.

Calling AxUtil to import model file “D:\AX_GST_Update\Microsoft Dynamics India GST AX 2012 R2 GA release\AX2012R2KB4019353\DynamicsAX2012R2-KB4019353-App\Models\dynamicsax2012r2-kb4019353-foundation.axmodel”.

Calling AxUtil to import model file “D:\AX_GST_Update\Microsoft Dynamics India GST AX 2012 R2 GA release\AX2012R2KB4019353\DynamicsAX2012R2-KB4019353-App\Models\dynamicsax2012r2-kb4019353-syplabels.axmodel”.

AxUtil call is complete.

AxUtil call returned errors:

Cannot insert duplicate key row in object ‘dbo.ModelElement’ with unique index ‘I_ModelElement_Id1Id2’. The duplicate key value is (42, 102947, 60001).

The statement has been terminated.

Error updating model database: Microsoft.Dynamics.Setup.AxSetupException: AxUtil call returned errors:Cannot insert duplicate key row in object ‘dbo.ModelElement’ with unique index ‘I_ModelElement_Id1Id2’. The duplicate key value is (42, 102947, 60001).

The statement has been terminated.

Hello Satish,

I am not sure but you can check which element is giving problem by sysmodelelement table

may be u have already one element with same id which this model is trying to insert.

Thanks Kunal for the reply.

Yes i have one record already.

Hello Satish,

is it customized one?

Hi Kunal,

Yes… I have delete the records one by one shown in error… After that patch got installed.

great. can you please mark thread as solved