debugging 数据转换失败-“由于可能丢失数据,无法转换值,”

pwuypxnk  于 2023-03-19  发布在  其他
关注(0)|答案(2)|浏览(168)

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

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

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.

我的Map:

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

ttcibm8c

ttcibm8c1#

您正在将CAMPAIGNNAME转换为uniqueidentifier,将CAMPAIGNID转换为string[DT_STR]。但是您的说明似乎指出CAMPAIGNID必须为uniqueidentifier
同样根据错误,您的设置似乎指示Failure on error。如果您确定转换正确并且不会截断,则可以将该属性更改为Ignore on error。或者,您可以使用Error output并将其重定向到另一个目标并检查结果。
另外,还不清楚为什么要转换所有列。添加源列和目标列的数据类型可能会更清楚。

ia2d9nvy

ia2d9nvy2#

对于任何偶然发现这个可怕错误的人,如果您尝试将字符串格式的GUID转换为uniqueidentifier列,可能是您的字符串GUID没有包含在{}中。请尝试在GUID周围添加花括号并尝试运行它。潜在的数据丢失消息应该会消失。

相关问题