SSIS执行数据流任务时出错 - 将excel导入sql表

时间:2011-09-20 10:15:04

标签: ssis

我创建了ssis包,它从excel文件中获取数据并将数据插入表中 我有一个Excel SourceOle db connection

但是我遇到了以下错误:

    [Excel Source [1]] Error: There was an error with output column "F2" (18) on     
    output "Excel Source Output" (9). The column status returned was: "The value could 
    not be  converted because of a potential loss of data.".


    [Excel Source [1]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. 
    The "output column "F2" (18)" failed because error code 0xC0209072 occurred, and  
    the error row disposition on "output column "F2" (18)" 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.


    [SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput 
    method on component "Excel 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.

`

4 个答案:

答案 0 :(得分:5)

该行:

The value could not be  converted because of a potential loss of data

建议你有一个字符串等字段可能比SQL表字段长。例如。你有一个60个字符的字符串,你试图插入Varchar(50)字段吗?

或者可能是Int或类似的十进制数?

检查您的数据类型是否匹配,换句话说。

答案 1 :(得分:2)

这是一个经典的数据转换错误。检查目标表的定义,可能是varchar数据类型太短。或者,当您将数据源连接到目的地时,不要选择表格,而是选择下拉列表旁边的“新建”。然后,SSIS为您建议一个表定义,其数据类型应该有效。

答案 2 :(得分:0)

有时Excel连接“失去了”。如果将鼠标悬停在列上,可能会发现数据类型不正确。对我有用的是取消选中列,保存没有它的更改,然后重新检查列。这将导致SSIS重新创建包后面的元数据。

答案 3 :(得分:-1)

取消选中来自excel文件的列...并重新创建...这将更改元数据:)工作