0

我正在使用 SSIS 将数据从 excel(.xls) 导入 SQL Server 2008。我已包含IMEX=1在 excel 连接管理器的连接字符串中。但是一列包含如下值:

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

在 SSIS 中使用 Excel 源和 OLE DB 目标之间的基本数据流转换\数据转换

例子

于 2012-11-19T13:55:32.933 回答
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 回答