While loop in sql server

declare @i int=10
while(@i<=20)
begin
print @i
set @i=@i+1
end

I hope this code is helpful.

Happy coding 🙂