• Jeff Moden - Wednesday, July 26, 2017 8:44 AM

    It actually serves a very important function... troubleshooting.  It's useless inside a proc but if someone is trying to troubleshoot the code in the proc, then it's nice to have the drop to do reruns of the code within the proc.  I leave it in as commented out code as a courtesy to the next poor slob that may have to test/troubleshoot the code within the proc.  It's especially helpful if you have a shedload of Temp Tables in the proc being troubleshot.

    Other than that, it's a waste of clock cycles for a proc in production.

    There's one exception to that rule... and that's to free up memory resources early on in the proc.  For that, though, it's better and faster to just truncate the Temp Table.

    My guess is this is some residual from dev/testing/debugging where temp tables were used, seen that before.
    😎

    It's not going to be the Globe on Atlas's shoulders, it's just pointless and wasted effort.