8152: String or binary data would be truncated
SQL ServerWhat does it mean?
You tried to write data longer than a column's defined length. SQL Server stops the statement to prevent data loss (2628 is the newer version of the same error that reports the column/value).
Why does it happen?
For example writing 15 characters into a VARCHAR(10) column, a target column narrower than the source, a data type/length mismatch, or insufficient field size in ETL/transfers.
How to fix it
Widen the column to fit the data (ALTER TABLE ... ALTER COLUMN) or shorten the data. On SQL Server 2019+, use error 2628, which shows the table/column/value that overflowed; on older versions, check columns one by one with LEN() to find the offending row. In transfers, align source and target schema lengths.
More from this engine
- 2601Cannot insert duplicate key row in object with unique index. The duplicate key value is ...
- 547The INSERT/UPDATE/DELETE statement conflicted with the FOREIGN KEY / CHECK constraint
- 18456Login failed for user
- 2628String or binary data would be truncated in table, column ...; truncated value
- 1222Lock request time out period exceeded
- 9002The transaction log for database is full due to ...
- 1105Could not allocate space for object in database because the filegroup is full