title: SQL run from Excel cannot use a temporary table
body: <p>I have been able to create a data connection from Excel to SQL Server and execute many SQL queries successfully. But I cannot get any TSQL to work if it includes a temporary table. For example:</p>
  
  <pre><code>select * into #t from compass3.dbo.freq
  select * from #t where freq_id&gt;2
  </code></pre>
  
  <p>(Clearly there is no need to use #t in this case: I'm just giving the most simple example.) This work fine in SSMS but when executed via Excel I get the error message "We couldn't refresh the connection 'audbbicube'. The table 'ion Query1' may not exist." </p>
  
  <p>In some other SO posts people suggested adding <code>set nocount on</code>, but that made no difference in this case.</p>