declare @test table( ClassID varchar(10))
insert @test
select '1' union all
select '2' union all
select '3' union all
select '4' union all
select '5' union all
select '6' union all
select '7' union all
select '8' union all
select '9' union all
select '10'
select * from @test
declare @tmp varchar(10)
declare @test2 table( ClassID varchar(10))
declare cur cursor for select * from @test
open cur
fetch cur into @tmp
while (@@fetch_status=0)
begin
insert into @test2 select ClassID from @test
fetch cur into @tmp
end
close cur
deallocate cur