由于可能会丢失数据,因此无法转换该值 [英] The value could not be converted because of a potential loss of data

查看:878
本文介绍了由于可能会丢失数据,因此无法转换该值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我很久以来就遇到了这个问题。



我拿到了数据从源(即DB2)到SQL Server 2008.



这样做我有这个错误。



Hi,

I am facing this problem since very long.

I am fetching the data from source (i.e DB2) into SQL server 2008.

while doing that I have got this error.

Error #1
[OLE DB Source [1]] Error: There was an error with output column "ZONE" (185) on output "OLE DB Source Output" (11). The column status returned was: "The value could not be converted because of a potential loss of data.".

Error #2
[OLE DB Source [1]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "output column "ZONE" (185)" failed because error code 0xC0209072 occurred, and the error row disposition on "output column "ZONE" (185)" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure.

Error #3
[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on component "OLE DB Source" (1) returned error code 0xC0209029.  The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the failure.





请帮助!!!!!!!!!!!



Pls Help !!!!!!!!!!!

推荐答案

首先检查每个表中的列定义:可能是:

1)DB2文本列比等效的SQL表长,因此SQL抱怨它必须截断数据。



2)DB2列包含二进制数据,您尝试将其插入基于文本的SQL列。



很抱歉,但如果没有具体的信息,我们就无法具体说明。
Start by checking the column definitions in each table: the chances are that either:
1) A DB2 text column is longer than the SQL table equivalent, so SQL is complaining that it would have to truncate data.
Or
2) The DB2 column contains binary data and you are trying to insert it to a text based SQL column.

Sorry, but we can't be specific without specific information.


首先 - 仔细检查列类型。在两个表上运行

sp_help'table_name'。您将看到一些指定长度,精度和比例的列。这些都应该匹配。



下一个:也许还有其他一些你看不到的东西。试试这个:

SELECT * FROM sys.triggers WHERE OBJECT_ID = OBJECT_ID('table_name')。如果有触发器,则可能尝试使用您的数据进行其他操作。



如果两者都结账,请回复



编辑:OP报告列和触发器检查正常。



这可能是使用某些第三方ODBC驱动程序的特定框架问题。这些驱动程序可能会导致翻译中的数据类型混乱。



看看有关驱动程序问题的讨论。有一个修补程序,它可能是你需要的修复:



https://support.microsoft.com/en-us/kb/969845 [ ^ ]
First - double check the column types. Run this on both tables
sp_help 'table_name'. You will see some columns specifying length, precision and scale. These should all match.

Next: maybe something else is happening that you can't see. Try this:
SELECT * FROM sys.triggers WHERE OBJECT_ID = OBJECT_ID('table_name'). If there is a trigger then that maybe trying to something else with your data.

Reply if both of those check out

OP reports columns and triggers check out fine.

This may be a specific framework issue that use some 3rd party ODBC drivers. These drivers can mess up the datatypes in translation.

Take a look at this discussion on the driver issues. There is a hotfix and it may be the fix you need:

https://support.microsoft.com/en-us/kb/969845[^]


这篇关于由于可能会丢失数据,因此无法转换该值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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