Solved

Export Data to SQL Table from Excel sheet

Posted on 2013-12-04
3
2,531 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
 
LVL 11

Expert Comment

by:SThaya
ID: 39697451
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PERFORMANCE OF SQL QUERY 13 83
How to simplify my SQL statement? 14 59
Unable to save view in SSMS 21 83
LAG_ROWID - how do I get the right order using this query? 2 25
If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

737 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