• Cadavre (5/2/2012)


    michael vessey (5/2/2012)


    depends if you need a BIGINT or not - i'd suggest just using yours for anything when max-min > 32,767 - otherwise use the nice small (low resource) version

    Actually, you should pretty much never use recursive CTEs for counting. See this article for why[/url].

    run the CTE and the cross join version you posted and look at the execution plans.... then see the difference

    the CTE has it's place when dealing with small numbers

    MVDBA