Using SQLSERVER to access DB2

  • My question is how to access DB2 through SQLSERVER 7.0. I nderstand SQLSERVER is not DRDA compliant, I want to make a connection to a DB2 database either through APPC or TCP/IP and have it so customers can use things like access, excel, sql query analyzer to query, update etc. into DB2. Is this possible? Do we set up an ODBC connection? I know how to do it from OS2 and DB2/2 but not with SQLSERVER. Thx,

    William H. Hoover

    Louisville, Ky

    sweeper_bill@yahoo.com


    William H. Hoover
    Louisville, Ky
    sweeper_bill@yahoo.com

  • I would think ODBC, but I am not familiar with everything you are asking. You can setup a linked server and allow access through SQL Server, but I am not sure if this meets your needs with DB2.

    Steve Jones

    steve@dkranch.net

  • You didn't mention what platform your DB2 is on. Here's a Microsoft Knowledge Base article through SNA or Host Integration Server 2000:

    http://support.microsoft.com/default.aspx?scid=kb;EN-US;q222937

    K. Brian Kelley

    bkelley@sqlservercentral.com

    http://www.sqlservercentral.com/columnists/bkelley/

    K. Brian Kelley
    @kbriankelley

  • What I did was install client access onto the server, reboot and patch it up to v4rm4.

    Then I created a System DSN using the Client access drivers.

    Then I created a linked server on sql server 2000. Use the OLE DB Provider for ODBC. The only info you have to fill in is the name of your odbc connection, then click on the security tab. Put in your sql server login name (could be sa) and alias it with your db2 login name and password.

    I have had difficulties connecting with v5rm0, but v4rm4 works well.

    Notes: Make sure when you create your ODBC connection you put in the correct catalog to access.

    When you go to query your db2 server from query analyzer the syntax is this:

    Select *

    From [Linked Server Name].[Catalog].[Schema].[Table Name]

    Also, remember that db2 is case sensative.

    This works for me accessing db2 on a IBM 510 AS/400 from SQL Server 2k SP2 and SQL Server 7.0 SP2.

    Email me at cpresley@hotmail.com if you need more help.

    Good luck.

    Chris.

    quote:


    My question is how to access DB2 through SQLSERVER 7.0. I nderstand SQLSERVER is not DRDA compliant, I want to make a connection to a DB2 database either through APPC or TCP/IP and have it so customers can use things like access, excel, sql query analyzer to query, update etc. into DB2. Is this possible? Do we set up an ODBC connection? I know how to do it from OS2 and DB2/2 but not with SQLSERVER. Thx,

    William H. Hoover

    Louisville, Ky

    sweeper_bill@yahoo.com


    Chris.

  • Also you may want to look into openquery if you will be running some pretty complex queries, so that they run on the DB2 server and the final data is returned to you, especially if you have to do any type of joins. As in the previous a lot of the work will take place on your server and openquery allows you to push this off to the other for optimization. We do this with Oracle on a SUN Unix server.

    SELECT * FROM OPENQUERY (LINKSERVERNAME,'SELETCT [id], [name], data1, data2 FROM tblWhaatever WHERE x = this and Y = this.')

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

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