Solved

Export Data to SQL Table from Excel sheet

Posted on 2013-12-04
3
2,575 Views
Last Modified: 2013-12-11
Experts,

I have been trying following to Export Data to SQL Table from Excel sheet and both are giving me errors. Excel sheet exists and the path is correct as well.
Since the second option didn't work, have been trying the first option by saving the excel file as .xls.

I would like to get this done through the script instead of DTS or using the wizard, appreciate your help and the question is "the table name (MyTable ) I have specified in the Select should be created before I run this?

I am using excel 2007 and SQL 2005

1. SELECT * INTO MyTable FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\Reports\Data.xls', 'SELECT * FROM [Items$]')
======================================================================
Error for above script
OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" returned message "The Microsoft Jet database engine could not find the object 'Items$'.  Make sure the object exists and that you spell its name and the path name correctly.".
Msg 7350, Level 16, State 2, Line 1
Cannot get the column information from OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".
=======================================================================
2. SELECT * INTO MyTable FROM OPENROWSET('Microsoft.Jet.OLEDB.12.0', 'Excel 12.0;Database=C:\Reports\Data.xlsx', 'SELECT * FROM [Items$]')
=======================================================================
Msg 7403, Level 16, State 1, Line 1
The OLE DB provider "Microsoft.Jet.OLEDB.12.0" has not been registered.
=====================================================================

Thanks in advance.
0
Comment
Question by:Tpaul_10
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 17

Assisted Solution

by:dbaSQL
dbaSQL earned 50 total points
ID: 39697251
If this is a one-time effort, the fastest way to do it is probably the import/export wizard in SSMS:

http://www.mssqltips.com/sqlservertutorial/203/simple-way-to-import-data-into-sql-server/
0
 
LVL 11

Accepted Solution

by:
SThaya earned 300 total points
ID: 39697448
hi,

 the above issue is related to the ACE provider which is not installed in your machine or server.please check with the below link

You can download and install only the ACE provider  from the following link, this supports office 2007 files both xls and xlsx file.

http://www.microsoft.com/downloads/details.aspx?FamilyID=7554F536-8C28-4598-9B72-EF94E038C891&displaylang=en
0

Featured Post

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question