SQL Server 字符串或二进制数据将被截断

我参与了一个数据迁移项目.当我尝试将一个表中的数据插入另一个表 (SQL Server 2005) 时,出现以下错误:

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):

消息 8152,级别 16,状态 13,第 1 行
字符串或二进制数据将被截断.

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.

推荐答案

您需要发布源表和目标表的表定义,以便我们找出问题所在,但最重要的是源表中的列大于目标列.可能是您正在以一种您不知道的方式更改格式.您要迁移的数据库模型对于弄清楚这一点也很重要.

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.

相关文章