Are the posted questions getting worse?

  • How is it possible that someone writes a cursor instead of using SUM()?

    I'm afraid that this database is full of these pieces of sh code and it's slower than a snail going backwards.

    http://www.sqlservercentral.com/Forums/FindPost1555701.aspx

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Jeff Moden (3/27/2014)


    Grant Fritchey (3/27/2014)


    jcrawf02 (3/27/2014)


    We have a written test we use to weed out people who don't know the first thing about SQL (report writing position, not DBA stuff), it's pretty basic, but I started it after listening to you guys tell horror stories. My favorite so far is the guy who left (!) without telling me (I usually give them 20 minutes or so by themselves), and left me this nice note (and his business card!)

    "John, [and no, that's not how I spell my name]

    From the gist of your questions, you are looking for someone far more "bitsy-bytsy" than am I. If this is the scope of the position, it is not for me. If I can help in some other way, call."

    Ha! What the heck is "bitsy-bitsy"?

    Heh... apparently, a term for some slacker with no clue how to do the job for someone else that actually knows what they're doing. πŸ˜‰

    Well, some guy came in for an interview and when he saw the written test he said he knew all of that but he didn't have the time to answer and that he could complete a three months project in less than a week. Maybe he had an interview to become part of the SQL Server team on Microsoft, but we never heard from him again.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Koen Verbeeck (3/27/2014)


    W00t w00t, this one makes my 12000th point. 😎

    Nice Koen! Congrats and keep up the good work!


    My mantra: No loops! No CURSORs! No RBAR! Hoo-uh![/I]

    My thought question: Have you ever been told that your query runs too fast?

    My advice:
    INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
    The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.

    Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
    Since random numbers are too important to be left to chance, let's generate some![/url]
    Learn to understand recursive CTEs by example.[/url]
    [url url=http://www.sqlservercentral.com/articles/St

  • jcrawf02 (3/27/2014)


    Grant Fritchey (3/25/2014)


    The Dixie Flatline (3/25/2014)


    My poster child interview disappointment: Good resume' on paper, but then the man walked in, opened up his laptop, and scrolled through a "cheat sheet" document each time he was asked a question. He rarely made eye contact as he paged up and down searching for answers. When his answers were so off base that we rephrased questions, he would argue that he had already answered them. Go figure.

    Cool. Open book interview questions. You don't mind if I just turn my MIFI on do you? I'll be connecting to SQL Server Central during the interview process. You guys just keep an eye out for any questions marked "URGENT." That'll be me.

    <sigh>

    I have two favorites, on opposite ends of the spectrum.

    Many moons ago, close to twenty years now, I interviewed a guy for an Access developer's position (yes, they used to pay for that). This guy answered every single question like he had written the product. It was amazing. I'd never met anyone who knew so much. We brought three different people in to ask questions and he aced them all. So we hired him. His first day on the job, he didn't get anything done... and I mean anything. Second day, we started watching him. He'd never sat in front of a computer before. He didn't know how to work the mouse. He was confused by the keyboard. He had clearly never even touched a computer before. But, we turned him away from the computer and asked him how to do stuff, and he knew it all. Weirdest darned thing I'd ever seen.

    My second favorite is short & sweet. We were interviewing someone for a senior level SQL Server position. After a couple of questions (which he didn't do well on) he stated, "Why are you asking me all these questions that are product specific. You should only ever be using ANSI standard commands & syntax and never, ever use any of the product specific controls or functions. Otherwise how can you nimbly shift between different platforms." And then he got vehement about it. It was fun.

    We have a written test we use to weed out people who don't know the first thing about SQL (report writing position, not DBA stuff), it's pretty basic, but I started it after listening to you guys tell horror stories. My favorite so far is the guy who left (!) without telling me (I usually give them 20 minutes or so by themselves), and left me this nice note (and his business card!)

    "John, [and no, that's not how I spell my name]

    From the gist of your questions, you are looking for someone far more "bitsy-bytsy" than am I. If this is the scope of the position, it is not for me. If I can help in some other way, call."

    Sounds like a win/win to me:

    - Him - took himself out of the running for a job he wouldn't like or knew he couldn't perform in

    - You - didn't need to waste time furthering interviewing him and/or hiring him when he wasn't qualified or motivated


    My mantra: No loops! No CURSORs! No RBAR! Hoo-uh![/I]

    My thought question: Have you ever been told that your query runs too fast?

    My advice:
    INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
    The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.

    Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
    Since random numbers are too important to be left to chance, let's generate some![/url]
    Learn to understand recursive CTEs by example.[/url]
    [url url=http://www.sqlservercentral.com/articles/St

  • Grant Fritchey (3/27/2014)


    jcrawf02 (3/27/2014)


    We have a written test we use to weed out people who don't know the first thing about SQL (report writing position, not DBA stuff), it's pretty basic, but I started it after listening to you guys tell horror stories. My favorite so far is the guy who left (!) without telling me (I usually give them 20 minutes or so by themselves), and left me this nice note (and his business card!)

    "John, [and no, that's not how I spell my name]

    From the gist of your questions, you are looking for someone far more "bitsy-bytsy" than am I. If this is the scope of the position, it is not for me. If I can help in some other way, call."

    Ha! What the heck is "bitsy-bitsy"?

    Grant, do we have to go there again? :-D:w00t:

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • Koen Verbeeck (3/27/2014)


    W00t w00t, this one makes my 12000th point. 😎

    The next 12,000 will be even easier! πŸ˜› Well done Koen!

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

  • BWAAA-HAAA-HAAAA-HAAA!!!! That's too funny. You guys even dubbed in a helo in the background!

    Whup? Wait a minute... What's that on your face??? BWAAA-HAAA-HAAAA-HAAA!!!! It's gray in the beard time for Mr. Jones and the next SQL Santa is born!!! πŸ˜€

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

  • Luis Cazares (3/27/2014)


    How is it possible that someone writes a cursor instead of using SUM()?

    I'm afraid that this database is full of these pieces of sh code and it's slower than a snail going backwards.

    http://www.sqlservercentral.com/Forums/FindPost1555701.aspx

    I believe it's due to developers that know how to write basic select, insert, update, delete statements, and for everything else, it's a cursor. Because all that they know is procedural (iterative) processing, and they won't learn the set-based way of doing it.

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • Luis Cazares (3/27/2014)


    How is it possible that someone writes a cursor instead of using SUM()?

    I'm afraid that this database is full of these pieces of sh code and it's slower than a snail going backwards.

    http://www.sqlservercentral.com/Forums/FindPost1555701.aspx

    Based on what I have to deal daily answer is easily :-):-(

    This kind of things happen when programmers write t-SQL.

  • Ville-Pekka Vahteala (3/27/2014)


    Luis Cazares (3/27/2014)


    How is it possible that someone writes a cursor instead of using SUM()?

    I'm afraid that this database is full of these pieces of sh code and it's slower than a snail going backwards.

    http://www.sqlservercentral.com/Forums/FindPost1555701.aspx

    Based on what I have to deal daily answer is easily :-):-(

    This kind of things happen when programmers write t-SQL.

    Here, here! Let's keep all the programmers out of SQL!

    What sayeth the SQLverse?


    My mantra: No loops! No CURSORs! No RBAR! Hoo-uh![/I]

    My thought question: Have you ever been told that your query runs too fast?

    My advice:
    INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
    The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.

    Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
    Since random numbers are too important to be left to chance, let's generate some![/url]
    Learn to understand recursive CTEs by example.[/url]
    [url url=http://www.sqlservercentral.com/articles/St

  • Luis Cazares (3/27/2014)


    How is it possible that someone writes a cursor instead of using SUM()?

    I'm afraid that this database is full of these pieces of sh code and it's slower than a snail going backwards.

    http://www.sqlservercentral.com/Forums/FindPost1555701.aspx

    And this one. (S)he's trying to calculate bed rents for private hospital treatment. At least it's nothing pharmaceutical. Patients would pop their clogs waiting for their prescriptions.

    β€œWrite the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

  • WayneS (3/27/2014)


    Luis Cazares (3/27/2014)


    How is it possible that someone writes a cursor instead of using SUM()?

    I'm afraid that this database is full of these pieces of sh code and it's slower than a snail going backwards.

    http://www.sqlservercentral.com/Forums/FindPost1555701.aspx

    I believe it's due to developers that know how to write basic select, insert, update, delete statements, and for everything else, it's a cursor. Because all that they know is procedural (iterative) processing, and they won't learn the set-based way of doing it.

    That's like getting a sparky (electrician, UK) to build your house, only he doesn't use mortar because he hasn't figured out the mix yet.

    β€œWrite the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

  • WayneS (3/27/2014)


    Luis Cazares (3/27/2014)


    How is it possible that someone writes a cursor instead of using SUM()?

    I'm afraid that this database is full of these pieces of sh code and it's slower than a snail going backwards.

    http://www.sqlservercentral.com/Forums/FindPost1555701.aspx

    I believe it's due to developers that know how to write basic select, insert, update, delete statements, and for everything else, it's a cursor. Because all that they know is procedural (iterative) processing, and they won't learn the set-based way of doing it.

    Believe it or not, I've seen this approach taken to another level before. Have the web page select a bunch of rows from the database. Then, on the web server, initialize a variable to zero so you can cursor through the rows and add up the total. Finally, you have a number to display on the screen. All the bytes returned from the database, the iteration on the web server, and the delay the users experienced were eliminated by using a simple SUM. Of course, the question of how it could be right came up because there wasn't enough code. Sigh.

  • dwain.c (3/28/2014)


    Ville-Pekka Vahteala (3/27/2014)


    Luis Cazares (3/27/2014)


    How is it possible that someone writes a cursor instead of using SUM()?

    I'm afraid that this database is full of these pieces of sh code and it's slower than a snail going backwards.

    http://www.sqlservercentral.com/Forums/FindPost1555701.aspx

    Based on what I have to deal daily answer is easily :-):-(

    This kind of things happen when programmers write t-SQL.

    Here, here! Let's keep all the programmers out of SQL!

    Hey, not cool. I have a right to be here too. :crying:

    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
  • Ed Wagner (3/28/2014)


    WayneS (3/27/2014)


    Luis Cazares (3/27/2014)


    How is it possible that someone writes a cursor instead of using SUM()?

    I'm afraid that this database is full of these pieces of sh code and it's slower than a snail going backwards.

    http://www.sqlservercentral.com/Forums/FindPost1555701.aspx

    I believe it's due to developers that know how to write basic select, insert, update, delete statements, and for everything else, it's a cursor. Because all that they know is procedural (iterative) processing, and they won't learn the set-based way of doing it.

    Believe it or not, I've seen this approach taken to another level before. Have the web page select a bunch of rows from the database. Then, on the web server, initialize a variable to zero so you can cursor through the rows and add up the total. Finally, you have a number to display on the screen. All the bytes returned from the database, the iteration on the web server, and the delay the users experienced were eliminated by using a simple SUM. Of course, the question of how it could be right came up because there wasn't enough code. Sigh.

    I've seen, in a CLR procedure, three selects which populated three datasets (Think that was the object used). The code then looped through them (3 loops deep), figuring out which rows from the three resultsets matched and ignoring unwanted rows.

    Yes, they re-implemented the nested loop join and the filter query operators in a CLR procedure.

    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 15 posts - 43,456 through 43,470 (of 66,709 total)

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