samedi 9 mai 2015

Weird 'returned data that does not match expected data length for column' error while the expected length is much bigger - SQL SERVER 2012

In my project I am rebuilding my Access database to an SQL Database. So to do this I am transferring the Access DATA to the SQL Database. I made sure they both have the same structure and the Access fields are modified correctly in the SQL database.

For most of the data this works. Except for 1 table. This table gives me the following weird error message:

OLE DB provider 'Microsoft.ACE.OLEDB.12.0' for linked server 'OPS_JMD_UPDATE' returned data that does not match expected data length for column '[OPS_JMD_UPDATE]...[OrderStatus].Omschrijving'. The (maximum) expected data length is 100, while the returned data length is 21.

So here some more information about both the Access and SQL field/column:

  • Access type: Short text
  • SQL type: nvarchar(MAX)
  • Access column data in it: Normal letters and & - % é + . , : being the 'not normal ones'.
  • A few empty Access records (which is allowed)
  • A total of 135314 record in the Access table

Iv'e set the SQL datatype to nvarchar(MAX) so that the field can never be to small, this didn't seem to help though..

*The OPS_JMD_UPDATE is the linked Access database

What causes this problem? Is it because some characters aren't allowed or..?

Aucun commentaire:

Enregistrer un commentaire