Friday, March 30, 2012

Link to DB2

Hi all,

I'd like to know what the best means available is to enable distributed
queries from a SQL Server 2000, on tables in BOTH SQL Server 2000 and a
remote DB2 server (the latter is not yet available for testing).

So, I would be wanting to write queries or SP's like:

select t1.field1, t1.field5, t1.field6, t2.field55, t2.field22
from MySQLServer.mydb.dbowner.tableXXX as t1
inner join ThatDB2Server.thatdb.thatowner.tableYYY as t2 on t2.field11
= t1.field99
where t1.field44 = @.foobar

I'm aware of at least two ways to go here:

1) in SQL Server 2000, create a linked server to the remote DB2
server, either using the wizard or sp_addlinkedserver, and using either
an OLEDB or ODBC connection;

2) using MS Host Integration Server (HIS).

Since I've only just today learnt about HIS, I don't know very much
about it.

Questions:
(a) are options (1) and (2) mutually exclusive, or does one depend on
the other?
(b) can I do (1) without having to bother with (2)? If this, where
would I get hold of the required OLEDB/ODBC Provider?
(c) Is there another way(s) to go about this task?

HYCH,
Robrobertino wrote:

> 1) in SQL Server 2000, create a linked server to the remote DB2
> server, either using the wizard or sp_addlinkedserver, and using either
> an OLEDB or ODBC connection;
> 2) using MS Host Integration Server (HIS).
> Since I've only just today learnt about HIS, I don't know very much
> about it.
> Questions:
> (a) are options (1) and (2) mutually exclusive, or does one depend on
> the other?
> (b) can I do (1) without having to bother with (2)? If this, where
> would I get hold of the required OLEDB/ODBC Provider?
It depends :) If you would like to use Microsoft OLEDB Provider for DB2
you have to use HIS but there are third party OLEDB drivers like
http://www.hitsw.com/products_servi...db2_dsheet.html
or IBM OLEDB provider. I worked with IBM and HIS provider for linked
servers and everything went OK but i was using only openquery to access
data not joins with tables from DB2.

Lukasz

No comments:

Post a Comment