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
declare @start int = 1000 declare @end int =1050 ;with numcte AS ( SELECT @start [SEQUENCE] UNION all SELECT [SEQUENCE] + 1 FROM numcte WHERE [SEQUENCE] < @end ) SELECT * FROM numcte