Notes about temporary tables support in MSSQL

MSSQL provides wide abilities to use it’s temporary tables.

I. Visible locally.

declare @SomeTableName table ( Id int, Title nvarchar(50) ); create table #SomeTableName ( Id int, Title nvarchar(50) )

Note that the first table will be in memory (in most cases), but second will be stored in tempDB

II. Visible to everyone:

create table ##SomeTableName ( Id int, Title nvarchar(50) )