Question: what is the difference between temp table and table variable in sql?
Answer: Temporary Tables are physically created in the tempdb database. These tables act as the normal table and also can have constraints, index like normal tables. Table Variable acts like a variable and exists for a particular batch of query execution. ... It is created in the memory database but may be pushed out to tempdb.