• dwain.c (9/9/2013)


    PRINT '========== Another Integer Math Method =========='

    SET STATISTICS TIME ON;

    SELECT @Bitbucket = RIGHT(1000000000 + C1*1000 + C2, 9)

    FROM #TestTable;

    SET STATISTICS TIME OFF;

    Oh, now that's just bloody clever. You stayed away from anything character based until "display time". Well done!

    --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)