Question : generate a list of numbers to a file

I need to generate a file with all of the numbers from 000000 thru 999999.  How would I do this?

Answer : generate a list of numbers to a file

Have you run the correct one? See comment 26376582. Here it goes again.

1:
2:
3:
4:
5:
6:
7:
8:
;with CTE as (    
        select '000000' as num    
        union all     
        select right('000000' + cast((cast(num as int) + 1) as varchar),6)  from CTE     
        where num < 999999     
)    
select * from CTE    
option (maxrecursion 0);
Random Solutions  
 
programming4us programming4us