Linked Server

  • Is it possible to insert data from SQL Server to DB2 server using linked server?

    Can it be done using a DTS package where I pass linked server name and remote database name as a parameters to a stored procedure?

    Any ideas?

  • If you are using DTS, can't you make a connection to DB2 without the linked server?

    You probably already have the DB2 client tools installed right ?

    Isn't there an OLE/DB or ODBC driver included in the tools?

     

    --------------------
    Colt 45 - the original point and click interface

  • I am told Linked Servers are faster than DTS. I use linked server through ODBC driver (DSN).

  • I find that hard to believe. I haven't dealt specifically with DB2, but interfacing to other vendors databases has always been extra slow using a Linked Server.

    Have you done any performance comparison?

     

    --------------------
    Colt 45 - the original point and click interface

  • Use this stored procedure it is using MS OLE DB Provider, assuming you are NOT using host integration server you can alter it as per your requirment

    EXEC sp_addlinkedserver

       @server='YOURDB2',

       @srvproduct='Microsoft OLE DB Provider for DB2',

       @catalog='DB2DATABASE',

       @provider='DB2OLEDB',

       @provstr='Initial Catalog=PUBS;Data Source=DB2;HostCCSID=1252;Network Address=10.0.0.1;Network Port=50000;Package Collection=admin;Default Schema=admin;'

    GO

    EXEC sp_addlinkedsrvlogin 'YOURDB2', false, 'SQLUSERNAME', 'DB2USERNAME', 'SQLPASSWORD'

    GO

    SELECT *

    FROM YOURDB2.DB2DATABASE.OBJECTOWNER.TABLENAME

    This will give you enough idea which route to take.

    ------------

    Sr. DBA Developer

    http://www.sqldba.org

     


    Kindest Regards,

    Syed
    Sr. SQL Server DBA

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply