• I'd have a hard time doing that because Number is a reserved word but to each their own. Also, are you implying that you have two separate tables? One for one-based and the other for zero-based? If so and if the use of BETWEEN is a pain, why not just have a single table starting at zero and a pass-through view with a >0 criteria? The underlying clustered index would still be used in either case.

    Also, although I appreciate why you called your tables what you did and why, would it not be less confusing to casual users of your system to call one-based Number1 and zero-based Number0?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)