1. Temporary Tables
Temporary tables are created in tempdb.
Create Table #Test (Id int, Name varchar(20))
If you need to create indexes on it then you must use a temporary table.
2. Table Variable
These are similar to temporary tables except with more flexibility.
Declare @Test Table (Id int, Name varchar(20))
3. Global Temporary Tables
Global temporary tables are visible to all SQL Server connections. When you create one of these, all the users can see it.
Create Table ##Test (Id int, Name varchar(20))