sql server临时表是否存在

create table #Left(EmpNo char(6),[hours] float)
--if exists(select * from tempdb..sysobjects where id=object_id('tempdb..#Left')and type='U')
if object_id('tempdb..#Left') is not null
PRINT '存在'
ELSE
PRINT'不存在'
drop table #Left

你可能感兴趣的:(SQL Server)