在sql开发过程中,经常需要创建临时表。在创建时,需要判断所创建的临时表是否存在,如果存在,把它drop掉:
if object_id('tempdb..#temptable') is not null
begin
drop table #temptable
end
在sql开发过程中,经常需要创建临时表。在创建时,需要判断所创建的临时表是否存在,如果存在,把它drop掉:
if object_id('tempdb..#temptable') is not null
begin
drop table #temptable
end