sql server - Drop temp table if it exists on SQL Azure -


is there better way drop temp table on azure sql?

begin try     drop table #custommap end try begin catch end catch 

maybe there no need drop temp tables on azure sql since tables dropped when session ended.

this

if (object_id('#candidates')) not null begin     drop table #candidates; end; 

or this

if (object_id('tempdb..#candidates')) not null begin     drop table #candidates; end; 

does not work.

in azure sql database can use drop if exists (die) syntax:

create table #temp (id int)  drop table if exists #temp 

Comments

Popular posts from this blog

html - height not adding height to a empty div -

Oracle SQL. How to select specific IDs where value of columns specify criteria? -

python - Robot Framework location and name of keyword -