Finding temp tables in SQL Server

Clean solution for testing for the existance of temp tabel in sql server:
http://www.thescripts.com/forum/thread81409.html

The solution is: 

IF OBJECT_ID(‘tempdb..#tmptab’) IS NOT NULL

(just in case that link goes away). 

Leave a comment