I am trying to import data from Excel to SQL without using the wizard as it is a process that needs to take place every week, so automation is a must. When I run the following script however, I get an error message:
Script:
IF OBJECT_ID('TEST Weekly Sales D') IS NOT NULL
DROP TABLE [TEST Weekly Sales D]
SELECT *
INTO [TEST Weekly Sales D]
FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Excel 12.0;Database=C:\.....\Weekly Sales D.xlsx',
['SHEET1$'])
GO
Error Message:
OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" returned message "Unspecified error". Msg 7303, Level 16, State 1, Line 5 Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".
The server does not have excel on it, but I was told this is not a problem. I installed the ACE OLEDB driver, but it seems to working intermittently.
Can someone please point out to me where I am going wrong?