title: Creating temp tables in sybase
body: <p>I am running into an issue with creating temp tables in Sybase db. We have a sql where we create a temp table, insert/update it and do a select * from it at the end of get some results. We are invoking this sql from the service layer using spring jdbc tmplate. The first run works fine, but the next subsequesnt runs fails with error</p>
  
  <pre><code>cannot create temporary table &lt;name&gt;. Prefix name is already in use by another temorary table
  </code></pre>
  
  <p>This is how I am checking if table exists:</p>
  
  <pre><code>if object_id('#temp_table') is not null
  drop table #temp_table
  
  create table #temp_table(
  ...
  )
  </code></pre>
  
  <p>Anything I am missing here?</p>