Crappy
Why don't you add an identity column to your temp table and then select between key values
ie
create table #temp (id_no identity (1,1), val varchar(50))
<insert your data>
for first ten
select val from #temp where id_no between 1 and 10
for next ten
select val from #temp where id_no between 11 and 20
etc.
Make id_no a key and roberts your fathers brother.