 <pre><code>if exists ( select * from tempdb.dbo.sysobjects o where o.xtype in ('U') and o.id = object_id(N'tempdb..#tempTable') ) DROP TABLE #tempTable; </code></pre> <p>[<a href="http://stackoverflow.com/questions/659051/check-if-temp-table-exist-and-delete-if-it-exists-before-creating-a-temp-table%5d%5b1%5d">http://stackoverflow.com/questions/659051/check-if-temp-table-exist-and-delete-if-it-exists-before-creating-a-temp-table][1]</a></p>