I have an Excel file(.xls) that I need to import to SQL Server database. I am trying to use the Import wizard. However, when I select the file and click next I get the warning "External table is not in the expected format.(Microsoft JET Database Engine)" . I opened the .xls file using a text editor. It looks like some html document.
<html xmlns="urn
chemas-microsoft-com
ffice
ffice"
xmlns:x="urnchemas-microsoft-com
ffice:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head>.................
I also used OPENQUERY to see if it works.
SELECT
*FROMOPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0 xml;HDR=Yes;Database=C:\myexcelfile.xls'
,'SELECT * FROM [Table1$]');
SELECT
*FROMOPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=C:\data\myexcelfile.xls'
,'SELECT * FROM [Table1$]')
I get the following errors.
OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" returned message "External table is not in the expected format.".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".
When I open the file and save it to overwrite the existing .xls file it works fine.
Is there a way to import such files using SSIS without having to open and save it?
Thanks in advance!
Tkaram