【问题标题】:Data conversion failed -"The value could not be converted because of a potential loss of data."数据转换失败 -“由于可能丢失数据,无法转换该值。”
【发布时间】:2015-06-29 09:18:59
【问题描述】:

我有一个简单的数据流,我从表中读取数据,进行一些数据转换,然后将其加载到另一个表中:

但是,当我运行包时,我收到以下错误:

Error: 0xC02020C5 at Atish to CRM, Data Conversion [142]: Data conversion failed while converting column "CAMPAIGNID" (27) to column "Copy of CAMPAIGNID" (206).  The conversion returned status value 2 and status text "The value could not be converted because of a potential loss of data.".
Error: 0xC0209029 at Atish to CRM, Data Conversion [142]: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "Data Conversion.Outputs[Data Conversion Output].Columns[Copy of CAMPAIGNID]" failed because error code 0xC020907F occurred, and the error row disposition on "Data Conversion.Outputs[Data Conversion Output].Columns[Copy of CAMPAIGNID]" 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: 0xC0047022 at Atish to CRM, SSIS.Pipeline: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "Data Conversion" (142) failed with error code 0xC0209029 while processing input "Data Conversion Input" (143). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.  There may be error messages posted before this with more information about the failure.

我的映射:

最后,由于该错误似乎是在抱怨“CAMPAIGNID”,因此 destination 表上它的数据类型是 uniqueidentifier。老实说,我不知道我在这里错过了什么。

【问题讨论】:

    标签: sql-server debugging ssis etl data-conversion


    【解决方案1】:

    您正在将CAMPAIGNNAME 转换为uniqueidentifierCAMPAIGNID 转换为string[DT_STR]。但是您的描述似乎表明CAMPAIGNID 必须是uniqueidentifier

    同样根据错误,您的设置似乎表明Failure on error。如果您确定转换正确并且不会出现截断,那么您可以将该属性更改为Ignore on error。或者,您可以使用 Error output 并将其重定向到另一个目的地并检查结果。

    还不清楚为什么要转换所有列。添加源列和目标列的数据类型可能会更加清晰。

    【讨论】:

    • 抱歉,请查看更新的错误消息和映射截图。在准备我的帖子时,这是一个诚实的错误。
    • 请同时添加您的输入数据类型
    猜你喜欢
    • 1970-01-01
    • 2022-08-22
    • 2012-07-29
    • 2018-11-05
    • 2017-12-29
    • 2012-11-07
    • 2021-05-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多