0

We are facing a weird error while exporting data in bacpac format from Azure SQL database and then restoring it back (using SSMS). It throws error related to

Truncated value: 2628

in one of the columns with size Varchar(256), collation is Latin1_General_100_CI_AS_SC_UTF8 (at source and at destination)

For some reason, there are few values with datalength 256 characters (Len is also 256) gets converted into 258 Datalength (Len is still 256) and then fails.

When we change the size of this field to 512 in the bacpac file, it passes. Any clues?

One more thing to notice is that encoding is broken in this field at source and when we query value in SSMS the characters printed are not human readable. We store the same value in one more field (for audit purpose), there we can find them in readable format.

Thanks

Pragmatic
  • 3,093
  • 4
  • 33
  • 62
  • Is it possible that the source column is `**N**varchar(256)`? That would return 256 UCS-2 code points which, when converted to UTF-8 encoding for your `varchar(256)` column, could exceed the 256 octets available for storage. – AlwaysLearning Jul 08 '21 at 08:40
  • Thanks @AlwaysLearning for your input. Both the fields are varchar (256). I have updated my question with some more details. – Pragmatic Jul 08 '21 at 11:55
  • HI @Pragmatic, it would be helpful to reproduce the issue if you provide some sample data. – Utkarsh Pal Jul 13 '21 at 09:49

0 Answers0