This code creates a linked server to an AS400 DB2 database. We have installed the as400 drivr on the cluster server (the name of the driver is IA4WV5R4)
sp_addlinkedserver @server=N'DB2400',
@srvproduct=N'DB2400 UDB for iSeries',
-- IBMDA400/IBMDASQL are OLE DB providers
-- for DB2 UDB for iSeries. IBMDASQL is
-- available with iSeries Access V5R4
@provider=N'IBMDASQL',
-- System Name
@datasrc=N'vf06.it.volvo.se',
@catalog='GBT71PD'
GO
sp_addlinkedsrvlogin @rmtsrvname=N'DB2400',
@useself='false',
@rmtuser=N'pcs',
@rmtpassword='pcs'
GO
EXEC sp_serveroption 'DB2400', 'rpc out', true
GO
SELECT * FROM OPENQUERY(DB2400,
'SELECT * FROM GBT71PD.T7F001')
No comments:
Post a Comment