Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2002
    Posts
    1

    Unanswered: Linked 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.

    BSA

  2. #2
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    809
    I would have expected the provider to be 'DB2OLEDB'.

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

    Code:
    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?
    Paul Young
    (Knowledge is power! Get some!)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •