I have two numbers as input from the user, like for example 1000 and 1050.
1000
1050
How do I generate the numbers between these two numbers, using
The best way is using recursive ctes.
declare @initial as int = 1000; declare @final as int =1050; with cte_n as ( select @initial as contador union all select contador+1 from cte_n where contador <@final ) select * from cte_n option (maxrecursion 0)
saludos.