run-insert-statement-x-number-of-times
create procedure insert_into_b
@numInserts int
as
begin
while @numInserts > 0
begin
insert into b (id)
select id from a
set @numInserts = @numInserts - 1
end
end
exec insert_into_b 2