Link to home
Start Free TrialLog in
Avatar of co2tw
co2twFlag for Korea, Republic of

asked on

AS/400 DB2 linked server problem

I'm using MS-SQL management studio and added linked server on my environment.
I can use openquery for my linked server.

ex)
select * from openquery(linked_server, 'SELECT * FROM [LIB_NAME].[PF_NAME]')

It works fine.
But, I wanna know if I can change the above expression like this.

select * from [linked_server].[LIB_NAME].[PF_NAME]

Of course, I failed.. Please let me know how this can work.
Thanks.




Avatar of momi_sabag
momi_sabag
Flag of United States of America image

sql server uses 4 part names, so you just need to try some combinations for your query
try

select * from [linked_server]..[LIB_NAME].[PF_NAME]
select * from [linked_server].[LIB_NAME]..[PF_NAME]
Avatar of co2tw

ASKER

I tried your query but I also failed.
please give me the descript of the 4 parts.

[linked_server].[what?].[LIB_NAME].[PF_NAME]
[linked_server].[LIB_NAME].[what?].[PF_NAME]
ASKER CERTIFIED SOLUTION
Avatar of momi_sabag
momi_sabag
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of co2tw

ASKER


I also tried but failed.

I'm sure that my server's machine name is correct and I also tried my ip address of the server.
But failed...
Do you have any other clue for this?
what is the exact error message you get?
Avatar of co2tw

ASKER

the error message is below.

An invalid schema or catalog was specified for the provider "MSDASQL" for linked server "DNA".
is it possible that this is a permission issue?
can you trace the As400 DB2 and check if your request ever made it through
Avatar of co2tw

ASKER

I didn't solve this problem yet but I'll accept the answer.
If the description for the connection 4 parts is correct, there might be a clue.
Anyway thanks.
Avatar of co2tw

ASKER

It didn't solve my problem absolutely but It gives me a clue to solve.