简体   繁体   English

SSIS加载Excel文件

[英]SSIS loading Excel file

This is my first time using SSIS, I'm getting this error. 这是我第一次使用SSIS,但出现此错误。

Using: VS 2015, Excel 2010 使用:VS 2015,Excel 2010

Exception from HRESULT: 0xC02020E8 Error at Data Flow Task [Excel Source [1]]: SSIS Error Code DTS_E_OLEDBERROR. 来自HRESULT的异常:0xC02020E8数据流任务[Excel Source [1]]中的错误:SSIS错误代码DTS_E_OLEDBERROR。
An OLE DB error has occurred. 发生OLE DB错误。 Error code: 0x80004005. 错误代码:0x80004005。

Error at Data Flow Task [Excel Source [1]]: Opening a rowset for "'R0270 Cases$'" failed. 数据流任务[Excel Source [1]]出错:打开“'R0270 Cases $'”的行集失败。 Check that the object exists in the database. 检查对象是否存在于数据库中。

The first 7 rows in the excel file are headers information. excel文件中的前7行是标题信息。 Row 8 has the column labels and data starts at 9. 第8行具有列标签,数据从9开始。

Excel Source Editor: Excel源代码编辑器:

Data access mode: Table or View 数据访问方式:表或视图

Excel Sheet drop-down, it errors out for the first 30 seconds then it populates with the sheet name. Excel工作表下拉菜单,在开始的30秒内会出错,然后使用工作表名称进行填充。

Any clue what's happening and how can I skip the first 7 rows. 任何线索,正在发生什么以及如何跳过前7行。 I have 100+ excel files and same thing happens on 8 different files. 我有100多个excel文件,同一件事发生在8个不同的文件上。

Thanks for your assistance. 谢谢你的协助。

Error possible solutions 可能的错误解决方案

  1. You have to add IMEX=1; 您必须添加IMEX=1; to your excel connection string, to helps excel to identify the data types correctly 到您的excel连接字符串中,以帮助excel正确识别数据类型
  2. Set the DelayValidation property of the OLE DB Source adapter to True . OLE DB Source适配器的DelayValidation属性设置为True
  3. Try removing spaces from sheet and excel file name 尝试从工作表和Excel文件名中删除空格

Reading from row 8 从第8行读取

Assuming that you have 4 columns 假设您有4列

  1. In the DataFlow Task, double click on the excel source Set the source to SQL Command 在DataFlow任务中,双击excel源将源设置为SQL Command
  2. Use the following command: SELECT * FROM [R0270 Cases$A8:D] , so it will start reading from the row number 8 ( D means the column number 4 in excel) 使用以下命令: SELECT * FROM [R0270 Cases$A8:D] ,因此它将从第8行开始读取D表示excel中的第4列)

References 参考文献

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM