Calendar table

  • Jeff Moden - Friday, February 9, 2018 6:56 AM

    patrickmcginnis59 10839 - Friday, February 9, 2018 6:30 AM

    Heck I'm not saying it doesn't happen either, but bad moves should have consequences.

    That's precisely why I'm pinging on Darko a bit.  😉

    Darko's code isn't the bad move, this "animal house" mode of running IT departments is. Today its someone TLDR'ing the instructions, tomorrow its Equifax puking my private info all over the web.

    Hey, just because bad things keep happening doesn't mean we have to stop griping about it right?

    edit: this is a pretty good calendar table routine that should address some of the concerns in any case, I'm a little suspicious about the easter calc given what I've read about this, but none the less its got some cool stuff in it.

    https://www.mssqltips.com/sqlservertip/4054/creating-a-date-dimension-or-calendar-table-in-sql-server/

    Also phil factors take on the easter calculation is pretty awesome! The calculation looks much different than the function in the first link.

    https://www.red-gate.com/simple-talk/blogs/calculating-easter-the-longest-scientific-project-ever/

  • I strongly disagree... Darko's code is a problem... several problems, actually.  But we're wasting time on that disagreement because neither of us will change our opinion there.

    As for the Easter Calculation, Peter Larsson shook it out pretty well by greatly simplifying the parts of the formula that won't change in the next several centuries.
    http://weblogs.sqlteam.com/peterl/archive/2010/09/08/fast-easter-day-function.aspx

    In truth, Peter's code is also a bit of a problem.  It's not necessary to use it as a function, especially a Scalar Function.

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

  • {Edit} Took a post on Easter dates down because I found differences between a couple and I don't actually know which one is correct.

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

  • I strongly disagree... Darko's code is a problem... several problems, actually. But we're wasting time on that disagreement because neither of us will change our opinion there.

    Its ok, it doesn't take any time. I am happy to advise in favor of reading documentation and to point out cautions about layering abstractions in T-SQL. You don't have to change your mind, its good for me to post these opinions in case anybody else would like to read them. There should be no harm in my posting these things even when agreeing about performance penalties with certain code patterns. Darko is free to take your advice too, I'm not going to demand he do differently.

  • patrickmcginnis59 10839 - Friday, February 9, 2018 8:40 AM

    I strongly disagree... Darko's code is a problem... several problems, actually. But we're wasting time on that disagreement because neither of us will change our opinion there.

    Its ok, it doesn't take any time. I am happy to advise in favor of reading documentation and to point out cautions about layering abstractions in T-SQL. You don't have to change your mind, its good for me to post these opinions in case anybody else would like to read them. There should be no harm in my posting these things even when agreeing about performance penalties with certain code patterns. Darko is free to take your advice too, I'm not going to demand he do differently.

    Agreed.

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

Viewing 5 posts - 31 through 34 (of 34 total)

You must be logged in to reply to this topic. Login to reply