I am wanting to create a numbers table that will populate 1,000,000 numbers. I will be using it to help create a calendar table. When I ran the script, it only created 65536 rows. I have not been able to find any settings that will allow me to create more rows. Below is the script I ran: All the articles I am finding have to do with exporting to Excel which I am not doing.
Thanks,
--auxiliary number table
CREATE
TABLEdbo.Numbers(
NumberintNOTNULL
CONSTRAINTPK_NumbersPRIMARYKEYCLUSTERED
);
--load numbers table with 1,000,000 numbers
WITH
t1AS(SELECT 0 ASnUNIONALLSELECT 0UNIONALLSELECT 0UNIONALLSELECT 0)
,t2AS(SELECT 0 ASnFROMt1t1a,t1t1b,t1t1c,t1t1d)
,t3AS(SELECT 0 ASnFROMt2t2a,t2t2b)
,numbersAS(SELECTROW_NUMBER()OVER(ORDERBYn)- 1ASnumberFROMt3)
INSERTINTOdbo.NumbersWITH(TABLOCKX)(
Number
)
SELECTnumber
FROMNumbers
WHERE
number< 1000000;