Regular user tables

To create regular user tables in a temporary table, specify the database name in the create table command:

create table tempdb..temptable (...)

Regular user tables in the temporary database:

or:

select select_list
into tempdb..temptable

You can create indexes on regular user tables created in the temporary database:

create index tempix on tempdb..temptable(col1)