Sunday, May 20, 2012

Table variable

table variable will store in temp db only. when the tempdb space is
full then it will create on memory.
It is not always true that table variable will create in memory.
see the test bellow
DECLARE @tablevar TABLE(col INT);
INSERT INTO @tablevar VALUES(1);
SELECT TABLE_NAME
FROM tempdb.INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME LIKE '%#%';