declare @count int
set @count = 0
while (@count < 10000)
begin
print RIGHT('0000' + CAST(@count AS VARCHAR), 4)
set @count = @count +1
end
set @count = 0
while (@count < 10000)
begin
print RIGHT('0000' + CAST(@count AS VARCHAR), 4)
set @count = @count +1
end