• jlennartz (9/27/2010)


    I guess I don't see how the sum of n got to 16 if n is alway 0?

    Jerry, hopefully someone will post a tidy explanation of how a recursive CTE works. In the meantime, run this SQL to see the entire contents of the 'l' table:

    with l as (

    select 32 as i, char(32) as s, isnumeric(char(32)) as n

    union all

    select i+1, char(i+1), isnumeric(char(i+1)) from l where i < 127

    )

    select * from l

    That should help you begin to understand what's going on.