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

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Save ouput of Stored Procedure to excel file
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

NehaSharma
Starting Member

India
2 Posts

Posted - 07/25/2013 :  00:17:33  Show Profile  Reply with Quote
Good Morning,
I am trying to save the output of a stored procedure in excel file, i am using following code

INSERT INTO
OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',
'Data Source=d:\book1.xls;Extended Properties=Excel 8.0;')...[Sheet1$]
exec rptworkorderstatus2 ''

but i am getting this error :
The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" does not contain the table "Sheet1$". The table either does not exist or the current user does not have permissions on that table.

Plz Correct me,thanks

Edited by - NehaSharma on 07/25/2013 00:25:48

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 07/25/2013 :  00:45:48  Show Profile  Reply with Quote
is excel file in use? do you've access to the path?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

jackv
Flowing Fount of Yak Knowledge

United Kingdom
2076 Posts

Posted - 07/25/2013 :  01:50:29  Show Profile  Visit jackv's Homepage  Reply with Quote
Check the file exists and and you have privileges.
A different method to export from SQL Server is to use Powershell , which does give you a fair bit of control - http://www.sqlserver-dba.com/2013/05/sql-server-export-to-excel-with-powershell.html

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.05 seconds. Powered By: Snitz Forums 2000