title: RODBC sqlQuery() returning error messages on successful execution
body: <p>This is a bit of a time-sensitive/emergency problem. I have some R code that involves a number of SQL queries using the RODBC package. This code runs every morning on a dedicated Linux server - it pulls down some data, does some statistics, and inserts the data back into an MSSQL DB.</p>
  
  <p>Today, our sysarch upgraded to Ubuntu 12.04.1, and since then, I'm having a bunch of problems with ODBC. After making a few changes, we got it so that ODBC connections can be established, but now there's an even bigger problem. Basically, I'm getting error messages from RODBC every time I do a CREATE or DROP command, even though the identified tables are created/dropped. Example (<code>bts.connect</code> is the result of <code>odbcConnect([connection information])</code>):</p>
  
  <pre><code>&gt; sqlQuery(bts.connect, "SELECT OBJECT_ID('tempdb.dbo.#tempscores')")
  1 1050250967
  </code></pre>
  
  <p>So the #tempscores table exists</p>
  
  <pre><code>&gt; sqlQuery(bts.connect, "DROP TABLE #tempscores")
  [1] "[RODBC] ERROR: Could not SQLExecDirect 'DROP TABLE #tempscores'"
  </code></pre>
  
  <p>Even though it exists, we “can’t” drop it</p>
  
  <pre><code>&gt; sqlQuery(bts.connect, "SELECT OBJECT_ID('tempdb.dbo.#tempscores')")
  1 NA
  </code></pre>
  
  <p>But we have dropped it.</p>
  
  <pre><code>&gt; sqlQuery(bts.connect, "CREATE TABLE #tempscores (dummy int)")
  [1] "[RODBC] ERROR: Could not SQLExecDirect 'CREATE TABLE #tempscores (dummy int)'"
  </code></pre>
  
  <p>We also can’t create it, but it exists and we can SELECT from it:</p>
  
  <blockquote>
    <p>sqlQuery(bts.connect, "SELECT OBJECT_ID('tempdb.dbo.#tempscores')")
       1 1066251024
    sqlQuery(bts.connect, "SELECT * FROM #tempscores")
        [1] dummy
        &lt;0 rows> (or 0-length row.names)</p>
  </blockquote>
  
  <p>I'm at wits' end, and I really need this to run successfully tomorrow morning for a client. Anybody have any idea what could be causing this strange behavior?</p>