Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
Administering
»
Export Query result to Excel Sheet
Export Query result to Excel Sheet
Rate Topic
Display Mode
Topic Options
Author
Message
venki_1276
venki_1276
Posted Thursday, August 13, 2009 7:10 AM
Valued Member
Group: General Forum Members
Last Login: Monday, November 23, 2009 9:34 PM
Points: 68,
Visits: 64
Hi all,
I am trying to Export query result to Excel sheet it gives error.
Code :
USE DBNAME
GO
EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE
GO
EXEC sp_configure 'Ad Hoc Distributed Queries', 1
GO
RECONFIGURE
GO
INSERT INTO OPENROWSET ('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=c:\Citys\city.xls;','SELECT city_id,city,state_Id,state FROM [Sheet1$]')
SELECT City_id,City,state_Id,(Select State From State Where state_id=S.state_id) AS state
from city S where status_ind='A'
AND city NOT IN (Select city from LatestZipcodes)
It gives error message like:
Msg 7399, Level 16, State 1, Line 3
The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7303, Level 16, State 1, Line 3
Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".
pls help me.
Post #770119
bitbucket-25253
bitbucket-25253
Posted Thursday, August 13, 2009 8:09 AM
SSCertifiable
Group: General Forum Members
Last Login: Yesterday @ 12:39 PM
Points: 5,103,
Visits: 20,220
If you are
NOT
using Excel 2007 read the following ariticle which also has sample code.
http://www.simple-talk.com/sql/t-sql-programming/sql-server-excel-workbench/
10:09 - spelling correction
If everything seems to be going well, you have obviously overlooked something.
Ron
Please help us, help you -before posting a question please
read
Before posting a performance problem please
read
Post #770181
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.