Are the posted questions getting worse?

  • Matt Miller (12/9/2008)


    while (@i<50000)

    BEGIN

    SELECT *

    Into #tempTable

    from MyHumongousTable --1,750,000 rows

    update MyNewTable

    set aBunchOfFields= #TempTable.aBunchOfFields

    From MyNewTable

    Inner Join #TempTable on MyNewTable.id=TempTable.id

    Where #TempTable.id=@i

    Drop table #temptable

    Set @i=@i+1;

    END

    What's your problem? There's no cursor in it. :hehe:

    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
  • GilaMonster (12/9/2008)


    Matt Miller (12/9/2008)


    while (@i<50000)

    BEGIN

    SELECT *

    Into #tempTable

    from MyHumongousTable --1,750,000 rows

    update MyNewTable

    set aBunchOfFields= #TempTable.aBunchOfFields

    From MyNewTable

    Inner Join #TempTable on MyNewTable.id=TempTable.id

    Where #TempTable.id=@i

    Drop table #temptable

    Set @i=@i+1;

    END

    What's your problem? There's no cursor in it. :hehe:

    Funny - that's the EXACT reaction I got when I tossed it back....:)

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

  • Ahhh, I miss digging through code somedays 😉

  • Matt Miller (12/9/2008)


    Funny - that's the EXACT reaction I got when I tossed it back....:)

    Just about every time I've done a presentation or informal training and mentioned the problems of the cursor, there's at least one person who'll recommend replacing the cursor with a while loop

    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
  • I think it speaks towards how we are as a community that we don't shoo "newbies" away with some of the various rude comments you do see on other sites. I think we all want the other guy to succeed in his endeavors and are willing to offer assistance. The problem comes in that we've practiced this behavior for long enough that the hand feeding has tamed the wild users and they no longer wish to fend for themselves.

    - Tim Ford, SQL Server MVPhttp://www.sqlcruise.comhttp://www.thesqlagentman.com http://www.linkedin.com/in/timothyford

  • GilaMonster (12/9/2008)


    I still think my favourite has to be this piece of code that I found when one of the devs complained that the dev server was very slow. The same code was on production, but fortunately, the data on prod was such that the code never entered the while loop.

    WHILE LEN(@DataSegment < 7000)

    SET @DataSegment = @DataSegment + ' '

    Heh. Well they know how to count, but not how to add, so this must be a pre-schooler, right? 😛

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • Lynn Pettis (12/9/2008)


    IF TAX_CODE = 1 THEN TAX_CODE = 0

    ELSE IF TAX_CODE = 0 THEN TAX_CODE = 1.I think that this is called a "Toggle". 😀

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • rbarryyoung (12/9/2008)


    GilaMonster (12/9/2008)


    I still think my favourite has to be this piece of code that I found when one of the devs complained that the dev server was very slow. The same code was on production, but fortunately, the data on prod was such that the code never entered the while loop.

    WHILE LEN(@DataSegment < 7000)

    SET @DataSegment = @DataSegment + ' '

    Heh. Well they know how to count, but not how to add, so this must be a pre-schooler, right? 😛

    :hehe: I never did identify the author.

    It's worse than that though. What does LEN ('abc ') return?

    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
  • Oh, right. :w00t:

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • Timothy Ford (12/9/2008)


    I think it speaks towards how we are as a community that we don't shoo "newbies" away with some of the various rude comments you do see on other sites. I think we all want the other guy to succeed in his endeavors and are willing to offer assistance. The problem comes in that we've practiced this behavior for long enough that the hand feeding has tamed the wild users and they no longer wish to fend for themselves.

    This is where those of us who are senior can step back a bit and allow the low hanging fruit to be picked up by the junior contributors. If you don't grab it, someone with a bit less knowledge might be inclined to take a shot at solving the problem themselves. That is how I got started answering posts on the various forums. I purposely have started to try and leave the simple questions alone, and target my efforts towards the complex problems that aren't easily answered by the average DBA.

    Not trying to toot my own horn in saying that, because I certainly have to do a bit of research and at times I have to send a post along to the appropriate expert in the SQL community for the problem at hand. What is really great is that the regular contributors are all open to being contacted for assistance on problems. I can email Paul Randal, or Geoff Hiten and they are more than happy to look at a problem that they otherwise wouldn't have.

    Jonathan Kehayias | Principal Consultant | MCM: SQL Server 2008
    My Blog | Twitter | MVP Profile
    Training | Consulting | Become a SQLskills Insider
    Troubleshooting SQL Server: A Guide for Accidental DBAs[/url]

  • rbarryyoung (12/9/2008)


    Lynn Pettis (12/9/2008)


    IF TAX_CODE = 1 THEN TAX_CODE = 0

    ELSE IF TAX_CODE = 0 THEN TAX_CODE = 1.I think that this is called a "Toggle". 😀

    Actually, its called not asking the user to enter the correct code. The screen told them to enter it one way then switch it behind the scenes.

  • It's been nice building a new system from scratch for the past year. I haven't had to look at anyone else's nasty code in a long time.

  • 208 posts on this one??? is that getting close to a new record or something?

  • Nah... the worst posts ever (there were 2 at the same time) both beat 209 by a mile. Remember {shudder} "Bankers Rounding"? Even some of the good guys started flaming on that one...

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

  • What happened to those threads??? I can only find 2 refferences to them and there's no navigation to see the rest of the posts...

    has it been rounded down to reduce the flamming???

    :w00t:

Viewing 15 posts - 196 through 210 (of 66,712 total)

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