26

ExcelドキュメントからデータベーステーブルにインポートするSSISパッケージがあります。次のエラーが発生します。

[Excel Source [1]] Error: There was an error with output column "ShipTo" (47) 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 "ShipTo" (47)" failed because error code 0xC0209072 occurred, and the
error row disposition on "output column "ShipTo" (47)" 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.

私は自分のデータ型が一致することを確認するために記事を読んで見つけました、そして私はそれをしました。Excelドキュメントには184行あり、これらのエラー(shipto)にリストされている列にはすべて同じ値があり、それは「すべて」です。前回実行したときにこれに遭遇しましたが、「すべて」が含まれているのは4行だけだったので、これらの値を手動で入力しただけですが、今回はあまり効率的ではありません。

宛先テーブルのShipTo列はVarchar(20)であるため、1桁の数値、2桁の数値、またはAllという単語の3つのうちの1つであるため、サイズが問題になることはありません。

誰かが私が試すことができる追加のアイデアを持っていますか?どんな助けでも大歓迎です。助けを提供できる人に感謝します。

4

5 に答える 5

29

このパッケージを最初に設定したとき、1 桁または 2 桁の数字が [ShipTo] 列の最初の値だったと思います。Excel から読み取るパッケージは、その入力フィールドに数値型を選択しました。そのフィールドの入力仕様が数値であるため、「ALL」という単語はパッケージに失敗します。これを事前に修正する方法はいくつかありますが、事後に修正する最も簡単な方法は、Excel ソースを右クリックし、[高度なエディターを表示...] を選択することです。そこから、[入力と出力のプロパティ] というタブを選択します。そのダイアログ ボックスの入力および出力セクションの最上部で、ShipTo 列を見つけます。それを見つけるにはドリルダウンする必要があります。DataType を "string [DT_STR]" に、長さを 20 に設定します。

[OK] をクリックしてから、パッケージを再度実行してみます。

于 2012-11-19T18:29:01.653 に答える