Table variables are not stored in memory, but in tempdb

Table-Variables just like Temp-Tables also gets stored in tempdb. This is a misconception among people and online forums that Table-Variables are memory variables or maintained in memory. To prove this I executed following code: CREATE TABLE #tempTab (j INT) INSERT INTO #tempTab VALUES (1) SELECT * FROM #tempTab SELECT TABLE_NAME FROM tempdb.INFORMATION_SCHEMA.TABLES GO DECLARE @tabVar TABLE…

0