create table #temp1 (myid int identity(1,1) ,tbid int)
insert into #temp1 select id from table1
create table #temp2 (myid int)
set @i = 10000
while @i < 10010
begin
select @rndnum=round(rand(square(@i))*(select max(myid) from #temp1),1)
insert into #temp2 values(@rndnum)
set @seed = rand(@rndnum)
set @i = @i + 1
end
select id from table1 where id in (select id from #temp2)