Friday, March 9, 2012

server with DB2

Hello,

I create a Linked server to a DB2 Database with this command

EXECUTE sp_addlinkedserver
@.server = 'test',
@.provider = 'MSDASQL',
@.srvproduct = 'DB2',

I can see the new linked server and the tables in the enterprise manager.

But when I try to access a table of the db2 database (select * from test..xyz.tablename) , I get this error message:

Server: Msg 7313, Level 16, State 1, Line 1
Invalid schema or catalog specified for provider 'MSDASQL'

Any thoughts or suggestions are appreciated.

Thanks in advance.

BSAI would have expected the provider to be 'DB2OLEDB'.

An example is provided in Books Online for establishing a liked DB@. server:

I. Use the Microsoft OLE DB Provider for DB2
This example creates a linked server named DB2 that uses the Microsoft OLE DB Provider for DB2.

EXEC sp_addlinkedserver
@.server='DB2',
@.srvproduct='Microsoft OLE DB Provider for DB2',
@.catalog='DB2',
@.provider='DB2OLEDB',
@.provstr='Initial Catalog=PUBS;Data Source=DB2;HostCCSID=1252;Network Address=XYZ;Network Port=50000;Package Collection=admin;Default Schema=admin;'

Also, when I reference a table via a linked server I use the reference <server name>.<database name>.<owner name>.<table name>, does DB2 need this kind of reference?

No comments:

Post a Comment