Beat this - comic relief for the day

  • Well, it makes sense. If it's "Y", this ensures you'll return "Y".

  • And potentially another good one:

    http://www.sqlservercentral.com/Forums/Topic546469-146-1.aspx?Update=1

  • Oooh, that's a lovely one Steve. There's a product to stay away from.

    I'll bet these are the very same developers that are in full-throated howl against using stored procs...

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Had to throw this one in for good measure. I know you all love to hate on developers, and here's a good lesson in why you shouldn't comment things you don't want others to see, particularly when it's the general populace in a browser window:

    Server Error in '/' Application.

    --------------------------------------------------------------------------------

    Exception Details: System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

    Source Error:

    Line 337:

    Line 338://TODO: need to make prc_DOC_sel_Search more efficient!:w00t: (ya think?)

    Line 339:return db.ExecuteDataSet("prc_DOC_sel_Search", spParams);

    Line 340:}

    Line 341:

    ---------------------------------------------------------
    How best to post your question[/url]
    How to post performance problems[/url]
    Tally Table:What it is and how it replaces a loop[/url]

    "stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."

  • haaaah my god! they've even put a note to self to fix the rubbish code! talk about incriminating

    (and they wonder how they got the nick names devo's and duh'velopers?)

  • This thread has made my day. thanks for posting all this stuff. 🙂

  • I found this one ealier this week.

    create myview as

    select mycode as ID,

    max(case when mycategory=1 then 1 else 0 end) as Code1,

    max(case when mycategory=2 then 1 else 0 end) as Code2,

    max(case when mycategory=3 then 1 else 0 end) as Code3,

    max(case when mycategory=4 then 1 else 0 end) as Code4,

    max(case when mycategory=5 then 1 else 0 end) as Code5,

    max(case when mycategory=6 then 1 else 0 end) as Code6,

    max(case when mycategory=7 then 1 else 0 end) as Code7,

    ....

    max(case when mycategory=41 then 1 else 0 end) as Code41,

    --keep going you're still not there

    ...

    max(case when mycategory=100 then 1 else 0 end) as Code100,

    --nope, there are still more

    ....

    max(case when mycategory=392 then 1 else 0 end) as Code392

    ugly enough, but maybe. Until you see it being used EVERYWHERE, with the follwing usage:

    select *

    from anyoldtable

    where id in (select Id from myview where code1=0 or code 2=0 or etc...)

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • Heh... oh boy... some folks are really gonna hate me...

    Absolutely the dumbest code I've ever seen is....

    SELECT sometestformula from DUAL; :P:P:P:P;)

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

  • jcrawf02 (8/6/2008)


    Had to throw this one in for good measure. I know you all love to hate on developers, and here's a good lesson in why you shouldn't comment things you don't want others to see, particularly when it's the general populace in a browser window:

    I had a really bad case of that with an Access front end a few years back. Anyone who works with Access forms knows that an unhandled error causes the project to break into code. Now the developer before me had left a comment in the code with some really, really foul language in it and saying really bad things about the client this app was for.

    Two days before the app was due to be launched, I was sitting at the client's site when one of the senior managers came in, absolutely furious. There had been an error and access had broken into code, two lines above that comment.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 9 posts - 16 through 23 (of 23 total)

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