<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: server code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sat, 06 Sep 2008 13:53:01 GMT</pubDate>
    <description>DZone Snippets: server code</description>
    <item>
      <title>Configure MSSQL Linked Server to DB2 (via ODBC System DSN)</title>
      <link>http://snippets.dzone.com/posts/show/3731</link>
      <description>1. Install DB2 on MSSQL machine&lt;br /&gt;2. Start Configuration Assistant. Add a new database mapping to the desired target DB2 database. Select option to create a System DSN along the way.&lt;br /&gt;3. Start Microsoft&#8217;s ODBC Data Source Administrator. There should be a System DSN created from the previous step. Configure it with the userid/password for the target DB2 database.&lt;br /&gt;4. Create linked server in MSSQL: EXEC sp_addlinkedserver @server = 'TMON', @srvproduct = '', @provider = 'MSDASQL', @datasrc = 'TMON'&lt;br /&gt;5. Map access to linked server: EXEC sp_addlinkedsrvlogin 'TMON', 'false', NULL, 'db2admin', 'db2admin'&lt;br /&gt;6. 2 ways to test the link: SELECT * FROM TMON..DB2ADMIN.USERS -- use uppercase for server, schema, table names SELECT * from OPENQUERY (TMON,'select * from users')&lt;br /&gt;&lt;br /&gt;Notes:&lt;br /&gt;    * TMON is the remote DB2 database, also used as the DSN name.&lt;br /&gt;    * Remote DB2 server uses access id: db2admin and password: db2admin&lt;br /&gt;    * USERS is a table in the remote DB2 database </description>
      <pubDate>Mon, 26 Mar 2007 08:49:53 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3731</guid>
      <author>wjchay (Chay Weei Jye)</author>
    </item>
  </channel>
</rss>
