The below program will do so
--generate a number table with 10 Lac(10,00,000) rows
;with cte as(
select rn=1
union all
select rn=rn+1 from cte where rn<1000000 --10 Lac
)
--Project the record
Select *
From cte
option (maxrecursion 0)
At first we have generated a number table with 10 Lac (1000000) rows using recursive CTE. Finally we have projected the records.