DECLARE @i int, @count int, @step int SELECT @i=1, @step=1, @count=5 WHILE @i <= @count BEGIN PRINT @i SET @i = @i + @step END