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

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Export to sql

Author  Topic 

monikam
Starting Member

1 Post

Posted - 2008-05-12 : 17:53:22
Hi,
I used code

USE [AA3Dev];
GO
INSERT INTO OPENROWSET (‘Microsoft.Jet.OLEDB.4.0', ‘Excel 8.0;Database=c:\contact.xls;’,
‘SELECT * FROM [Sheet1$]‘)
SELECT TOP 5 FirstName, LastName
FROM Person.Contact
GO

to export data from sql server to excel but i am getting this error

OLE DB provider “Microsoft.Jet.OLEDB.4.0? for linked server “(null)” returned message “The Microsoft Jet database engine could not find the object ‘SheetData1$’. 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)”.

can anybody help me out to get rid of this?
Thanks!

cognos79
Posting Yak Master

241 Posts

Posted - 2008-05-12 : 20:30:07
make sure you use the right datasheet name. This problem occurs when you sheet name different from the actual datasheet name.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-05-13 : 02:33:13
Also make sure the file should exist in server's directory
More info here
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -