how to create sql server cte from a while loop my loop like this
declare @ind as int declare @code as nvarchar set @ind = 0 while @ind < 884
Below query selects values from 0 to 884:
;WITH T(Num)AS ( SELECT 0 UNION ALL SELECT Num+1 FROM T WHERE T.Num < 884 )SELECT Num FROM T OPTION (MAXRECURSION 0);