if object_id('tempdb..#t') is not null
drop table #t
IF OBJECTPROPERTY ( object_id('tempdb..#t'),'ISTABLE') = 1
print 'Authors is a table'
ELSE IF OBJECTPROPERTY ( object_id('tempdb..#t'),'ISTABLE') = 0
print 'Authors is not a table'
ELSE IF OBJECTPROPERTY ( object_id('tempdb..#t'),'ISTABLE') IS NULL
print 'ERROR: Authors is not an object'
或者简单一点
if ( object_id('tempdb..#t') is not null ) --- temp table has been created!