Question: what is the difference between temp table and temp variable?
Answer: The Scope of the Temp Variables are limited to the current batch and current Stored Procedure, but the scope of a Temp Table is wider than for Temp Variables. ... Temp Variables must declare a table variable inside the dynamic SQL but a Temp Table can use Temporary Tables created prior to calling the dynamic SQL.