Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Syntax error in From running SMSS import Excel to SQL Expand / Collapse
Posted Friday, May 10, 2013 11:38 AM


Group: General Forum Members
Last Login: Monday, September 9, 2013 11:03 AM
Points: 21, Visits: 140
I am trying to import multiple .xls files into a single SQL 2008 db table using a query. The import wizard works fine for a single file, but I have over 300 that need to go into the sql table.

This is the query I am using in the import/export wizard:
'Excel 8.0;Database=\\files\census\Census_02092013', [Census$])

that returns this error:
Syntax error in FROM clause.(Microsoft JET Database Engine)

Ultimately, I want to save as SSIS Package and run for all the files with the filename_mmddyy but it would help to know why I am getting this error.
Post #1451700
Posted Friday, May 10, 2013 12:07 PM



Group: General Forum Members
Last Login: Today @ 2:46 PM
Points: 13,882, Visits: 35,811
if your SQL2008 is 64 bit, you must install the 64 bit ACE drivers; the JET driver is only valid for 32 bit, and it won't work on .xlsx files(or files saved from office 2007/2010 even if .xls?) at all .

This is a working, tested, openrowset command that works for me:
EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'AllowInProcess', 1 
EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'DynamicParameters', 1
'Excel 12.0;Database=C:\Data\BlockGroups_2010\AKblockgroup.xls',

for installation/setup instructions for the ACE drivers, take a look at this thread:


help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
Post #1451707
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse