Umachandar Jayachandran - MS
There is no reason to check for #tempTable if you are creating the temporary table within a SP and using it there. Local temporary tables (#something) are scoped to the batch / session / module. SQL Server 2000 onwards allows you to reference say a temporary table created in a SP inside a trigger or other SPs called from the main one. Global temporary tables are instance specific so you will have to serialize creation/deletion etc. In any case, you can use OBJECT_ID function to check for temporary tables. Specify the temporary table using 3-part name like:
if OBJECT_ID('tempdb..#test') is not null
--- temp table exists