• If you run all the lines in the question in a query window you will see you don't get an invalid object error. The table doesn't get dropped before the selects are complete.