Question: what is the difference between table variable and temp table in sql server?
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.