Monday, 10 February 2014

The given value of type String from the data source cannot be converted to type nvarchar of the specified target column.

If you are upgrading to a later cumulative update and try to import a model you may get this error if you haven’t followed the steps.

2014-02-10_1309

You have to run the powershell command before you start the imports. This updates the model store schema to accept new models.

Initialize-AXModelStore

I wanted to find out what was changed in SQL. So, I ran an SQL trace to see which table caused the problem. Then I found that the ModifiedBy and CreatedBy fields where extended from 5 characters to 8 characters.

Before (CU6) After (CU7)
2014-02-10_1310 2014-01-27_1054

2 comments:

Grant Eldridge said...

I'm experiencing this exact issue importing the model store from a testing environment that was upgraded to CU7. After running "initialize-AXmodelstore" successfully I attempt the import either with powershell or axutil. After sometime it comes back with this error. I have made sure the AOS services are stopped.

Anonymous said...

I met the same issue here, it fixed my problems now, thanks a lot!