Using the code below (which I found here), a variable with 20 million rows is being created. Where do I find the stored variable. I was able to locate the tables I've created but this particular variable isn't visible.
My end goal is to export this variable and its values in a CSV format. How do I make that happen.
Declare @p_NumberOfRows Bigint
--We need 20 million rows
Select @p_NumberOfRows=20000000;
With Base As
(
Select 1 as n
Union All
Select n+1 From Base Where n < Ceiling(SQRT(@p_NumberOfRows))
),
Expand As
(
Select 1 as C
From Base as B1, Base as B2
),
Nums As
(
Select Row_Number() OVER(ORDER BY C) As n
From Expand
)
Select n from Nums Where n<=@p_NumberOfRows
--Remove Maximum Recursion level constraint
OPTION (MaxRecursion 0);