Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Querying a linked server (datasource)

Status
Not open for further replies.

KCcasey

Programmer
Sep 30, 2003
69
NZ
Hi Folks,

I've added a data source as a linked server - - but I'm having problems figuring out how to query it.

Heres the set-up of my linked server...

[Blue]SRV_NAME:[/Blue]
CBA_linkedINMASTER
[Blue]SRV_PROVIDERNAME:[/Blue]
MSDASQL
[Blue]SRV_DATASOURCE[/Blue]
CBA

... I've tried using a linked server name, but that didn't work. I think because I didn't supply the catalog or the schema names. Then I tried using the OPENROWSET function and that failed as well.

Can anyone

A) Tell where I can find more information about my datasource? (ODBC Administrator wasn't very helpful)

B) Tell me whats wrong with my OPENROWSET or SELECT (using linked serve name) statement?

Code:
SELECT a.*
FROM OPENROWSET('MSDASQL',
   'CBA;SERVER=CBA_linkedINMASTER',
   'SELECT * FROM INMASTER') AS a

Code:
SELECT *
FROM CBA_linkedINMASTER...[INMASTER]
GO

Error message returned when trying either of the above statements...

Code:
[RED]Server: Msg 7399, Level 16, State 1, Line 5
OLE DB provider 'MSDASQL' reported an error. The provider did not give any information about the error.[/RED]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IDBInitialize::Initialize returned 0x80004005:  The provider did not give any information about the error.].
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top