问题描述
我正在尝试通过SSIS将Excel文件(.xls
)导入到SQL Server中的表中.但是SSIS似乎无法将文件识别为有效的Excel文件.我收到以下错误:
I am trying to import an Excel file (.xls
) via SSIS to a table in SQL Server. But SSIS doesn't seem to recognize the file as a valid Excel file. I get the following errors:
错误1:
错误2:
错误3:
我的连接管理器属性是一个Excel Source,其属性如下所示:
My connection manager properties is an Excel Source, its properties look like this:
我正在通过变量传递Excel文件路径. Excel文件看起来不错,并且未损坏.我试图放置一个固定的Excel路径,尝试将其放置在Connection String属性(固定路径和变量)中,但是这些都无济于事.
I am passing the Excel file path through a variable. The Excel file looks OK and is not corrupted. I tried to put a fix Excel path, try to put it in Connection String property (fix path and variable), but nothing of this helped.
有人可以帮助我吗?
推荐答案
主要错误是:
当Excel文件已损坏并且无法通过Access Database Engine(OLE DB提供程序)打开Excel文件时,即使您可以从Excel打开文件,也会发生这种情况.在类似的情况下,手动打开文件并将其另存为新文件可以解决问题.
This happens when the Excel file is corrupted and cannot be opened by Access Database Engine (OLE DB provider) even if you can open the file from Excel. In a similar case opening the file manually and saving it as a new file may do the trick.
这篇关于获取“外部表不是期望的格式".尝试在SSIS中导入Excel文件时出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!