I'm having a problem with my SQL script:
SELECT
SP.[MobileNumber],
SP.[LastName],
SP.[FirstName]
FROM SampleTable1 SP
INNER JOIN OPENROWSET
(
'Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\devpc11\sample.xls;',
'SELECT
MobileNumber,
LastName,
FirstName
FROM [SampleData$]') T
ON SP.[MobileNumber] = T.[MobileNumber]
GO
when i try to execute this, it generates this error:
Msg 7357, Level 16, State 2, Line 1 Cannot process the object "SELECT MobileNumber, LastName, FirstName FROM [SampleData$]". The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" indicates that either the object has no columns or the current user does not have permissions on that object.
Is there any solution for this? i really can't find any in the past 3 hours.. Basically, i just want to manipulate data from an excel file, then save it to sql server 2005 database, but for now, i want to retrieve data from the excel file to the sql server.. thanks for the help..