In modern versions of SQL Server (2014+) you can create the indexes when you create the table. EG create table #t(id int primary key, a int, index ix_a nonclustered(a)) Also you can create the temp table before the snapshot transaction starts.