Tested in SQL 2000 & 2005:
IF OBJECT_ID('tempdb..#tmp') IS NOT NULL PRINT 'exists.' ELSE PRINT 'does not exist.'