Also, sometime SQL Server's in-memory table variables can be useful. They are limited by memory but fast and they require no special permissions (I think?).
DECLARE @employee TABLE
EmployeeID INT PRIMARY KEY NOT NULL,
INSERT INTO @employee VALUES (1, 'Jakob')
SELECT * FROM @employee
Table variables are not in memory only objects. They are logged in temodb. Table variables only last for execution and don't generate statistics.
Thanks for the clarification regarding tempdb. It seems that as of SQL Server 2017 you can create in-memory table variables.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.