title: RODBC: sqlUpdate() doesn't recognise index column
body: <p>My database table looks approximately like this:</p>
  
  <pre><code>+-----+-------+--------------------+-----------+----------+
  | ID1 | ID2   | FilePath1          | FilePath2 | Status   |
  +-----+-------+--------------------+-----------+----------+
  | 1   | Test1 | MyFolder\R\Folder1 | NULL      | Open     |
  | 2   | Test2 | MyFolder\R\Folder2 | NULL      | Open     |
  | 3   | Test3 | MyFolder\R\Folder3 | NULL      | Finished |
  | 4   | Test4 | MyFolder\R\Folder4 | NULL      | Finished |
  +-----+-------+--------------------+-----------+----------+
  </code></pre>
  
  <p>The first column (ID1) is defined as PK. However, ID2 is also unique.</p>
  
  <p>Now I'd like to be able to change <code>FilePath2</code> and <code>Status</code> with R using <code>sqlUpdate()</code> from <code>RODBC</code> package. So I try the following:</p>
  
  <pre><code>db.df &lt;- data.frame(ID1=1, ID2='Test1',
                      FilePath2='MyFolder\R\Folder5', Status='Finished',
                      stringsAsFactors=FALSE)
  
  sqlUpdate(myconn, db.df, tablename='mytable', index='ID2', verbose=TRUE)
  </code></pre>
  
  <p>wherein <code>db.df</code> is a data frame with one row and column names corresponding to those within the database table (however, I leave out some of the columns, in this case <code>FilePath1</code>, and I'd prefer to leave out <code>ID1</code>, too, if possible). My aim is to get the following:</p>
  
  <pre><code>+-----+-------+--------------------+--------------------+----------+
  | ID1 | ID2   | FilePath1          | FilePath2          | Status   |
  +-----+-------+--------------------+--------------------+----------+
  | 1   | Test1 | MyFolder\R\Folder1 | MyFolder\R\Folder5 | Finished |
  | 2   | Test2 | MyFolder\R\Folder2 | NULL               | Open     |
  | 3   | Test3 | MyFolder\R\Folder3 | NULL               | Finished |
  | 4   | Test4 | MyFolder\R\Folder4 | NULL               | Finished |
  +-----+-------+--------------------+--------------------+----------+
  </code></pre>
  
  <p>I get the folllowing error:</p>
  
  <pre><code>Error in sqlUpdate(myconn, db.df, tablename = 'mytable', index = 'ID2',  : 
  index column(s) ID2 not in database table
  </code></pre>
  
  <p>What might be the reason for this problem?</p>
  
  <hr>
  
  <p>EDIT: I've bypassed the problem by sending a direct SQL Query:</p>
  
  <pre><code>out.path &lt;- 'MyFolder\\\\R\\\\Folder5'
  update.query &lt;- paste("UPDATE mytable ", 
                    "SET FilePath2='", out.path, "', Status='Finished' ",
                    "WHERE ID2='Test1'", sep="")
  dummy &lt;- sqlQuery(myconn, update.query)
  </code></pre>
  
  <p>Although this might not be a neat way, it does what it should do. However, I still don't understand what's the matter with <code>sqlUpdate</code>, so I hope someone can shed light on it.</p>