• WARNING! Storing PART NUMBERS as FLOAT will eventually and absolutely screw you to the deck without warning.

    DECLARE @PartNumber FLOAT;

    SELECT @PartNumber = 1234567890123456;

    SELECT @PartNumber AS ScrewedALittle;

    SELECT @PartNumber = 12345678901234567;

    SELECT @PartNumber AS ScrewedALot;

    If you store the part "number" as a VARCHAR (as you would other "numbers" that aren't really numbers such as telephone numbers, zip codes, SSNs, etc) , then you can have your "*" cake and eat it, too! 😀

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