Can't get 4 part naming to work on as400 link
Posted on 2006-06-16
I have a two part question:
1) I have an as400 linked through my sqlexpress 2005. I am successfull in quering the database using this statement:
Select * From OpenQuery(MHAS400,'Select * From QGPL.DLY_PROD')
However, I would like to use the four part naming. I am using this statement, but not sure what to use for the QSECOFR.
select * from MHAS400.QGPL.QSECOFR.DLY_PROD
MHAS400 -linked server
QGPL - library
QSECOFR - user with acces to library (this is where I am not sure I have the correct info)
So what is the 3rd section of the 4 part naming convention?
2) And will I be able to accomplish my goal pulling data from both the AS400 and SQL in the same statement similiar to this...
select * from MHAS400.QGPL.??.DLY_PROD as A
inner join SQLServer.SQLDBe.DBO.SQLTable as B on B.USADATE = A.USADATE
and retrieve data from both server much like querying two sql servers?
Thanks for the help on this.