SQL Server String or binary data would be truncated

Jim Evans picture Jim Evans · Jun 17, 2011 · Viewed 503.8k times · Source

I am involved in a data migration project. I am getting the following error when I try to insert data from one table into another table (SQL Server 2005):

Msg 8152, Level 16, State 13, Line 1
String or binary data would be truncated.

The source data columns match the data type and are within the length definitions of the destination table columns so I am at a loss as to what could be causing this error.

Answer

IAmTimCorey picture IAmTimCorey · Jun 17, 2011

You will need to post the table definitions for the source and destination tables for us to figure out where the issue is but the bottom line is that one of your columns in the source table is bigger than your destination columns. It could be that you are changing formats in a way you were not aware of. The database model you are moving from is important in figuring that out as well.