Comments and notes on SQL Server 2000, 2005, and T-SQL
Tested in SQL 2000 & 2005:
IF OBJECT_ID('tempdb..#tmp') IS NOT NULL
PRINT 'exists.'
ELSE
PRINT 'does not exist.'
About Steve Gray
Steve is a seasoned (translate: old) developer in VB and ASP.NET. He spends most of his time in Dynamics GP, writing custom mods for consulting firms. Crystal reports, eConnect, VS Tools for Dynamics... anything that comes along.