The code below works and is quite precise, but is it OK to do it like this as against the other 'standard' ways ?
--Drop table if exists
begin try
drop table #temp
end try
begin catch
print 'table does not exist'
end catch
--Create table
create table #temp(a int, b int)
IF NOT EXISTS/OBJECT_ID IS NULLmethods are more concise.Try catchis overkill here. If one needs additional actions when table doesn't existif ... begin additional-actions endwill do.