Hi,
Im finding the way of connecting to DB 2 database which is exixst in the AS400
machine to do some data manupulation.Please attach the SQL cording.
Thanks
Pubudu
You have to use the linked server...
Here the sample query..
Code Snippet
EXEC sp_addlinkedserver
@.server = 'MyDB2Server',
@.provider = 'DB2OLEDB',
@.srvproduct = '',
@.provstr = 'Provider=DB2OLEDB;Network Transport Library=TCPIP;Network Address=XXX.XXX.XXX.XXX;Initial Catalog=MyCtlg;Package Collection=MyPkgCol;Default Schema=Schema;User ID=myUsername;Password=myPassword;'
Exec sp_addlinkedsrvlogin
@.rmtsrvname = 'MyDB2Server',
@.useself = true,
@.locallogin = null,
@.rmtuser = 'DB2UserName',
@.rmtpassword = 'DB2Password'
Go
Select * from MyDB2Server...Tablename
No comments:
Post a Comment