I have a simple query listed below:
select * from #TmpTbl
drop table #TmpTbl
I am wondering if there is a way in sql that automate the drop table#TmpTbl if I stop in the middle of the execution process? So I dont have to highlight drop table #TmpTbl
and run to clear this below error msg:
Msg 2714, Level 16, State 6, Line 1
There is already an object named '#TmpTbl' in the database.
Highlight one TmpTbl is not an issue to clear that error but imagine if I have more than 10 tmptbls? Is that a way I add a code to handle this?