4.00 database restore in new NAV 2009 SP1 SQL database

RoelofRoelof Member Posts: 377
I'm try to restore a 4.00 database backup in a new NAV 2009 SP1 SQL database. During the restore I'm receiving the following message:
'Item unit of Measure table contains a value in a code field that cannot be used with Micorosoft Dynamics NAV Classic. Field: Item No., Value: WP BIJOUX MP HEADERS

(The Item no. value seems to be a valid value. It doesn't exceed the 20 characters)

Any ideas?
Roelof de Jonghttp://www.wye.com

Comments

  • David_SingletonDavid_Singleton Member Posts: 5,479
    This isn't a field length issue, its a collation issue.

    Try going to the collation settings (File->Database->Alter -> Collation tab) and untick "Validate Code Page".

    if that works you need to find out which character in "WP BIJOUX MP HEADERS" is not acceptable. My guess would be that one of the <spaces> is not really a space. Or it could be you imported this item via SQL or ODBC and one of the characters is not as it seems. To test this, copy paste it into the Description field, and see if the Search description is identical.
    David Singleton
  • RoelofRoelof Member Posts: 377
    Yes, I found the problem. You were right. The 'Item No.' in the Item Unit of Measure record was corrupt due to an import. I fixed it and will create a new backup to restore. Cross my fingers.
    Roelof de Jonghttp://www.wye.com
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Be aware that if there is one there maybe more.

    You can write some simple code to locate the errors and fix them. Just crate a reprot that scans the table and add a line like:
    If "Item No." = UPPERCASE("Item No.") then
      currreport.skip;  // the lines that print are the errors.
    
    // or to fix them
    "Item No." := UPPERCASE("Item No.");
    modify;
    

    Beware though that this is not a good way to fix them, since they will no longer link to the Item table correctly.
    David Singleton
  • RoelofRoelof Member Posts: 377
    Thanks for the code. That would work.
    Yes, I double checked for more item nos. It looked like there was only one. So, I think I'm fine. But thanks for the note.
    Roelof de Jonghttp://www.wye.com
Sign In or Register to comment.