Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Export SQL table data to Excel 2007
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

itnagaraj
Yak Posting Veteran

India
70 Posts

Posted - 03/25/2013 :  08:57:32  Show Profile  Reply with Quote
I have run the below mentioned query to export the data -

insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=D:\test.xlsx;HDR=YES',
'SELECT * FROM [SheetName$]') Select id,description,lookupCode FROM tblLookupMaster

But i am getting the below error-

OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" returned message "Unspecified 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)".



Kindly help.

V.NAGARAJAN

bandi
Flowing Fount of Yak Knowledge

India
2241 Posts

Posted - 03/25/2013 :  09:46:54  Show Profile  Reply with Quote
Check this link
http://blogs.msdn.com/b/spike/archive/2008/07/23/ole-db-provider-microsoft-jet-oledb-4-0-for-linked-server-null-returned-message-unspecified-error.aspx
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 03/25/2013 :  09:48:04  Show Profile  Reply with Quote
For xlsx you should be using ACE provider

http://www.connectionstrings.com/excel-2007#ace-oledb-12-0

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.28 seconds. Powered By: Snitz Forums 2000