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

SQL Server String or binary data would be truncated(SQL Server 字符串或二进制数据将被截断)
本文介绍了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.

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

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Execute complex raw SQL query in EF6(在EF6中执行复杂的原始SQL查询)
SSIS: Model design issue causing duplications - can two fact tables be connected?(SSIS:模型设计问题导致重复-两个事实表可以连接吗?)
SQL Server Graph Database - shortest path using multiple edge types(SQL Server图形数据库-使用多种边类型的最短路径)
Invalid column name when using EF Core filtered includes(使用EF核心过滤包括时无效的列名)
How should make faster SQL Server filtering procedure with many parameters(如何让多参数的SQL Server过滤程序更快)
How can I generate an entity–relationship (ER) diagram of a database using Microsoft SQL Server Management Studio?(如何使用Microsoft SQL Server Management Studio生成数据库的实体关系(ER)图?)