title: A way to check if the temporary table exists or not
body: <p>I have this following query :</p>
  
  
  
  <pre class="lang-sql prettyprint-override"><code>IF NOT EXISTS (SELECT 1
                 FROM   sysobjects
                 WHERE  id = Object_id('tempdb..TEMP_THETH_DETAILS'))
    EXECUTE (
  'CREATE TABLE tempdb..TEMP_THETH_DETAILS( THETH_ID NUMERIC(5) NOT NULL, LANGUAGE VARCHAR(3) DEFAULT ''EN'' NOT NULL)'
  )
  
  GO 
  </code></pre>
  
  <p>The problem is the checking, it seems tempdb doesnt take on consideration if not exist, maybe because the table was create in the tempdb.<br> So my question is there a way I can check if the temporary table exists or not ?</p>