• I wrote the function in the code below to quickly generate number tables.

    It executed this code to load a table with 1,000,000 numbers in 6.780 seconds.  When I ran it to load a table with 10,000,000 numbers, it took about 136 seconds.  100,000 rows took 0.610 seconds, and 10,000 rows took 0.063 seconds.

    declare @t datetime
    declare @n table( number int )
    set @t = getdate()
    insert into @n
    select
     number
    from
     -- Function F_TABLE_NUMBER_RANGE available on this link
     -- http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=47685
     F_TABLE_NUMBER_RANGE(1,1000000)
    select ElapsedTime = getdate()-@t