Charles Ezzell (MSFT)
Guest
|
Posted:
Mon May 02, 2005 4:52 pm Post subject:
Re: Microsoft OLE DB and DB2 connectivity. |
|
|
I've personally never used TSQL to create a linked server (until today <g>),
but right-click and add it manually.
But, here goes my attempt (HIS 2004, 2000 does not have the "Connection
Pooling" property):
USE master
GO
EXEC sp_dropserver 'OSPRY_TSQL', 'droplogins'
GO
EXEC sp_addlinkedserver
@server = 'OSPRY_TSQL',
@srvproduct = 'Microsoft OLE DB Provider for DB2',
@provider = 'DB2OLEDB',
@provstr='User ID=CHARLIEE;Password=charliee;Initial
Catalog=S10D823B;Network Transport Library=TCP;Host CCSID=37;PC Code
Page=1252;Network Address=OSPRY;Network Port=446;Package
Collection=CHARLIEE;Default Schema=CHARLIEE;Process Binary as
Character=False;Units of Work=RUW;Default Qualifier=F58BMCPP;DBMS
Platform=DB2/AS400;Persist Security Info=True;Connection Pooling=True'
GO
Then:
select * from OSPRY_TSQL.S10D823B.CHARLIEE.MSDB2BANK
returns:
JONES 2643
SMITH 10000
DOE 5000
Note that I do not have the "Provider=DB2OLEDB" in the provider string.
HTH,
Charles
"Jeff York" <JeffYork@discussions.microsoft.com> wrote in message
news:16EAC315-A1D8-4480-86EE-CB637B309590@microsoft.com...
| Quote: | Can someone please take a look at this and give me some suggestions
I set up an OLE DB dsn using the HIS client tool. I copied the string from
teh .udl file and am trying within TSQL to create a linked server to a
DB@
database on an AS400. MY error message is : Error 7330: could not fetch a
row
from OLE DB provider 'unknown' I would love follow up questions as I am
very
new at non native linked servers. Below is how I set up the server
(wthout
the login proc.)Thanks!
EXEC sp_addlinkedserver
@server = 's10ce05e',
@srvproduct = 'Microsoft OLE DB Provider for DB2',
@Provider='DB2OLEDB',
@provstr =
'Provider=DB2OLEDB;Persist Security Info=False;User ID=YORK2323A;Initial
Catalog=S10CE05E;Data Source=TEST;Mode=ReadWrite;Network Transport
Library=TCPIP;Network Address=10.16.128.65;Package Collection=; Default
Schema=ALTLIB'
GO |
|
|