Causes and Solutions for Data Management "Data truncated for column" in DMS
Explains why the "Data truncated for column" error occurs in DMS when you reduce a field length, and how to resolve it.
Issue
When you execute a DDL statement in Data Management (DMS), the following error is returned.
Data truncated for column
Cause
This error occurs when you reduce a field length to a value that is shorter than some of the existing data. For example, if a field is 128 bytes and already contains data longer than 64 bytes, changing the field length to 64 bytes triggers this error.
Solutions
Verify that the field length change is necessary. If so, find the rows whose data exceeds the target length, then update or delete that data so all values fit within the new length. After that, reduce the field length.
note: We recommend that you do not change field lengths in production tables. Before you proceed, back up your data to prevent data loss or exceptions. You can use Alibaba Cloud DBS to create a backup. For more information, see what is DBS.
Scope
- Data Management (DMS)