Wednesday, March 12, 2014

SQL Error: String or Binary data would be truncated

Issue: SQL error during Insertion of records to a custom table
"String or Binary data would be truncated" and the SQL insert command is shown in the error infolog.

The issue will occur only if you have modified the field column length of a table after the records are created in Dynamics AX. When you are trying to insert the records, even though your data is within the column length, the existing rows might be inconsistent with the new data inserted. No synchronization errors are shown but the error will be only upon insert.

Delete the affected column and recreate the column with the correct length, impact existing data might be lost. Make sure to evaluate the issue's pro's and con's before actually deleting the columns and as a Golden rule always always backup the Database/Table before any columns are deleted. You don't want to have nasty surprises or abnormal behaviors after the deletion.

No comments:

Post a Comment