SQL Server字符串或二进制数据将被截断 [英] SQL Server String or binary data would be truncated

查看:273
本文介绍了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):


Msg 8152,Level 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.

这篇关于SQL Server字符串或二进制数据将被截断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆