A temporary table will get automatically dropped at the end of the session that created it. Often
this means that you won’t need to worry about dropping temporary tables, however there are occasions
where you might want to explicitly drop the table. There are several ways of doing this but I usually
use the following code :
IF OBJECT_ID ('tempdb..#MyTempTable')
IS NOT NULL
DROP TABLE #MyTempTable
Related Articles
The following articles may also be of interest :
Link back to this article :
https://www.sqlmatters.com/Articles/Dropping a temporary table.aspx
Keywords
TSQL,temp,table