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
 General SQL Server Forums
 New to SQL Server Programming
 SQL Mail

Author  Topic 

govind_ind12
Starting Member

5 Posts

Posted - 2010-06-10 : 06:38:51
I want sent report automatically from SQL daily 12.00 Am, I used below code but it is not working.


INSERT INTO OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\testing.xls;', 'SELECT Name, Date FROM [Sheet1$]')
SELECT [Name], GETDATE() FROM msdb.dbo.sysjobs
GO

it will display error message.

OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" returned message "The Microsoft Jet database engine could not find the object 'Sheet1$'. Make sure the object exists and that you spell its name and the path name correctly.".
Msg 7350, Level 16, State 2, Line 2
Cannot get the column information from OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".

Anybody guide me,
I put my head in this.

K. Govindaraj

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-06-10 : 06:42:39
As it says, make sure the sheet name sheet1
Aslo make sure to read few pages of http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926

Madhivanan

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

- Advertisement -