title: How to add an IBM DB2 server to SQL Server's Linked Server
body: <p>From .Net, I'm able to connect to the DB2 database:</p>
  
  <ol>
  <li>First I include a reference to "IBM.Data.DB2.iSeries"<br></li>
  <li><p>Then I create a new IBM.Data.DB2.iSeries.iDB2Connection. The connection string is</p>
  
  <pre><code>DataSource=ChaDb2Server;UserID=MyUsername;Password=MyPassword;
  </code></pre></li>
  <li><p>Then I create an IBM.Data.DB2.iSeries.iDB2Command, and so on.</p></li>
  </ol>
  
  <p>Now I'm trying to get my SQL Server 2005 to access the same data directly. In SQL Server Management Studio, I right-click on Linked Servers, and select "New Linked Server..."</p>
  
  <pre><code>Linked Server:   ChaDb2Server
  Provider:        IBM OLE DB Provider for DB2
  Product Name:    ???
  Data Source:     ChaDb2Server
  Provider String: DataSource=ChaDb2Server;UserID=MyUsername;Password=MyPassword;
  Location:        ???
  </code></pre>
  
  <p>I can leave Location blank, but Product Name can't be empty and I don't know what to fill in here.</p>
  
  <p>On the Security tab, I select "Be made using this security context" and I repeat the UserID and password.</p>
  
  <p>The linked server gets created, but when I try to expand Catalogs / default / Tables, I get an error message:</p>
  
  <pre><code>OLE DB provider 'IBMDADB2.DB2COPY1' reported an error. Authentication failed. (Microsoft SQL Server, Error: 7399)
  </code></pre>
  
  <p>I have no idea where the name IBMDADB2.DB2COPY1 came from.</p>
  
  <p>Also, when I try to select data:</p>
  
  <pre><code>Select * from ChaDB2Server.ChaDb2Server.Information_Schema.Tables
  </code></pre>
  
  <p>I get a similar error:</p>
  
  <pre><code>Msg 7399, Level 16, State 1, Line 1
  OLE DB provider 'IBMDADB2.DB2COPY1' reported an error. Authentication failed.
  </code></pre>
  
  <p>Obviously there's something missing in the way that I link the servers. Anybody know how to do this?</p>