You could use a while loop and a counter something like
DECLARE @counter1 int
DECLARE @total_count1 int
SET @counter1 = 1
SET @total_count1 = N
WHILE @counter1 < = @total_count1
BEGIN
"CODE HERE"
SET @counter1 = (@counter1 + 1)
END
I hope this helps,
jim