0

SSIS を使用して、Excel(.xls) から SQL Server 2008 にデータをインポートしています。IMEX=1Excel接続マネージャーの接続文字列に含めました。ただし、列は次のような値で構成されます。

4-Hour Engineer Dispatch ASPP Engr Dispatch 1: Up to 1 dispatch (8 hours) per year.  Hours exceeding allocation billed @ 1.5x hourly rate w/ 8-hr min Engr Dispatch:  8-hrs to arrive on-site from Ciena's determination of need  On-Site Engineer Dispatch - 8 Hour ASPP Engr Dispatch 8: Up to 8 dispatch (64 hours) per year.  Hours exceeding allocation billed @ 1.5x hourly rate w/ 8-hr min Engr Dispatch:  NBD to dispatch from Ciena's determination of need Per Incident On Site Support ASPP Engr Dispatch 12: Up to 12 dispatch (96 hours) per year.  Hours exceeding allocation billed @ 1.5x hourly rate w/ 8-hr min Engr Dispatch:  Next day to arrive on-site from Ciena's determination of need  Resident Engineer Engr Dispatch:  2-hrs to arrive on-site from Ciena's determination of need Engr Dispatch:  4-hrs to arrive on-site from Ciena's determination of need ASPP Engr Dispatch 2: Up to 2 dispatch (16 hours) per year.  Hours exceeding allocation billed @ 1.5x hourly rate w/ 8-hr min N

実際、その Excel ファイルには約 600 行あります。ただし、上記の値は 450 行の後にのみ存在します。したがって、その列のデータ型はnvarchar(255)代わりにデフォルトとして使用されるntextため、エラーが発生します。

誰でも助けてください...よろしくお願いします...

4

2 に答える 2

0

デフォルトでは、Excel は最初の 8 行を使用してデータ型を決定します。

レジストリでサンプリング サイズを増やすことができます (http://ddkonline.blogspot.ca/2008/05/ssis-excel-data-source-error-text-was.html)。

この鍵は常にそこにあるとは限らないようです。私のマシンでは、HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\12.0\Access Connectivity Engine\Engines\Excel.

TypeGuessRowsレジストリで検索できます。

于 2012-11-19T16:49:20.633 に答える
0

SSIS では、Excel ソースと OLE DB 変換先の間で Basic Data Flow Transformations\Data Conversion を使用します。

于 2012-11-19T13:55:32.933 に答える