Archiving sales orders errors
Problem
Sales order archiving can sometime give the following errors. Can apply to 7.00.175, 7.01.00, 7.02.01 databases.
String or binary data would be truncated.
The error is caused when there are sales orders with Email logs which have message bodies greater than 255 characters in length. Another cause of the error is when the PrintlogID is greater than 20 characters in length.
Another cause could be due to the length of the Description field in SO_SalesHistory being smaller than the Description field in SO_Lines in which case the below script is required to be run.
ALTER TABLE SO_SalesHistory ALTER COLUMN Description VARCHAR(255) NULL
Archiving sales orders that included lines for service manager jobs errored as follows:
The problem was caused by service manager jobs linking part lines to sales order lines. Download and apply the attached stored procedure to the relevant database.
Solution
SQL skills are required
A working knowledge of SQL Management Studio is required to complete this task
Download and apply the attached modified stored procedure to correct the issue.