Retail offline sync service: string or binary data would be truncated error

Offline Sync service fails to synchronize data with error

Retail offline sync service: string or binary data would be truncated error

Description

Offline Sync service fails to synchronize data with error "Bulk command BulkInsertCommand failed with the following exception. Rows will be retried during single apply. System.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated."

Reason

  1. Schemas of store and offline databases were different. This can happen, when store database was upgraded but offline database – not (or vise versa).

Steps that worked for me

  1. If AX version is earlier than R3 – run Database Utility for offline database to upgrade it.
  2. Otherwise modify Offline database schema manually (by running SQL scripts), make sure all offline transactions came to store database. After – recreate offline database (to have schema fully equal to store database)