• drew.allen - Tuesday, January 30, 2018 11:37 AM

    K. Brian Kelley - Tuesday, January 30, 2018 11:21 AM

    Another idea for a PK is a composite key (two columns) consisting of the year + the day of the year. There are some uses for this.

    I would just use the date itself.  It's only a single field instead of being a composite key.  It's more human readable.  I could see having an index on year/day of the year, but I would not make it the PK.

    Drew

    +1000 to that.

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