Here is what I tried SQLSister:
sp_addlinkedserver N'Excel', N'Jet 4.0',
N'Microsoft.Jet.OLEDB.4.0',
N'c:\Names.xls', NULL, N'Excel 8.0'
GO
sp_addlinkedsrvlogin N'Excel', false, sa, N'ADMIN', NULL
GO
SELECT *
FROM EXCEL...Trust$
GO
Here is the error Message I get :
Server: Msg 15028, Level 16, State 1, Procedure sp_addlinkedserver, Line 79
The server 'Excel' already exists.
(0 row(s) affected)
(1 row(s) affected)
(0 row(s) affected)
(1 row(s) affected)
Server: Msg 7314, Level 16, State 1, Line 3
OLE DB provider 'EXCEL' does not contain table 'Trust$'. The table either does not exist or the current user does not have permissions on that table.
OLE DB error trace [Non-interface error: OLE DB provider does not contain the table: ProviderName='EXCEL', TableName='Trust$'].
Here is my excel data
ID Name
1 Mike
2 Nitish
3 Peter
4 Scott
5 Russell
Ive named the range Trust.
Don't know why it dont work.
The server 'Excel' already exists.
this error comes only because I created it on the first attempt while trying this but i dont think see it as a hinderance to the rest of the T-SQL.
Thanks for your help already. Hope you can help me more with regard to this.
Thanking you,
QLearnerNow