Are the posted questions getting worse?

  • Roy Ernest (4/20/2010)


    CirquedeSQLeil (4/19/2010)


    Paul White NZ (4/19/2010)


    CirquedeSQLeil (4/19/2010)


    I am putting the finishing touches on draft 1 of a new article. Anybody out there willing to give it a review?

    What's it about?

    Simple subject - sp_who2. Hoping it will be worth the read and effort.

    I would love to look at it as well... There was a thread here about creating a new version of sp_who2. It was sp_who5 if I am not mistaken and I was also working on it. So this will interest me.

    Just looked over sp_who5 (thanks for sending it my way). I noted two things in it that are hitting points in my article - it uses sysprocesses still and also runs dbcc inputbuffer.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Paul White NZ (4/19/2010)


    CirquedeSQLeil (4/19/2010)


    Simple subject - sp_who2. Hoping it will be worth the read and effort.

    By the by, are you aware of sp_WhoIsActive?

    http://sqlblog.com/blogs/adam_machanic/archive/2009/12/03/who-is-active-v9-57-fast-comprehensive-dmv-collection.aspx

    I use it a lot.

    I just finished looking over that proc. Well, I skimmed a lot because I don't have a lot of time to do an in-depth look at ~3800 lines.

    I did not a few things, he still uses sysprocesses (I believe it is for the blocking process count), implements a ton of dynamic sql, uses 4 cursors, and has this little bit of code.

    SELECT TOP(2147483647) ' + '*,...'

    That nugget of code is interesting because I figured he would have been specific about the columns he wanted returned.

    Overall a very comprehensive piece of code. I do like the extensive documentation.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Unfortunate score - really.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • CirquedeSQLeil (4/20/2010)


    I did note a few things, he still uses sysprocesses (I believe it is for the blocking process count), implements a ton of dynamic sql, uses 4 cursors, and has this little bit of code.

    SELECT TOP(2147483647) ' + '*,...'

    Yep, and all for very good reasons. It is some of the most highly-tuned code I have ever seen.

  • CirquedeSQLeil (4/20/2010)


    Unfortunate score - really.

    :laugh: Though if I remember correctly, the Number of the Beast is 616, not 666...

  • Paul White NZ (4/20/2010)


    CirquedeSQLeil (4/20/2010)


    I did note a few things, he still uses sysprocesses (I believe it is for the blocking process count), implements a ton of dynamic sql, uses 4 cursors, and has this little bit of code.

    SELECT TOP(2147483647) ' + '*,...'

    Yep, and all for very good reasons. It is some of the most highly-tuned code I have ever seen.

    He went to great lengths to ensure proper indexes and statistics were created. I just thought with all of that other effort, he missed a simple select *.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Paul White NZ (4/20/2010)


    CirquedeSQLeil (4/20/2010)


    Unfortunate score - really.

    :laugh: Though if I remember correctly, the Number of the Beast is 616, not 666...

    That's ok we can assign 6666 to Emperor Paulpatine:-D

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Tom.Thomson (4/20/2010)


    Gianluca Sartori (4/20/2010)


    Thanks, Tom. So, you're a Scot, aren't you?

    Well, I used to be a Scot. But I got married so now I'm a slave. πŸ˜€

    LOL! That's set me up for the day, thanks Tom πŸ™‚

    β€œ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

  • Please tell me THIS doesn't happen a lot...*groan*.

    Gaby________________________________________________________________"In theory, theory and practice are the same. In practice, they are not." - Albert Einstein

  • GabyYYZ (4/21/2010)


    Please tell me THIS doesn't happen a lot...*groan*.

    Looks like someone was either paid by the line or had a quota of lines of code to meet.:-D

    Similar to paying a programmer by number of bug fixes....someone could get rich.

    Greg E

  • GabyYYZ (4/21/2010)


    Please tell me THIS doesn't happen a lot...*groan*.

    You have to admit, that completely qualifies as "WTF"

    "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

  • Not by me but based on some of the posters, I wouldn't be surprised!! :w00t:

    Although, it is an example of re-usable code, which I'll do whenever possible. It's just not good re-usable code.

    -- You can't be late until you show up.

  • I've seen even worse things in my app (Visual Basic):

    Public const SC AS String = "'" 'Yes, you got it right, it's a single quote

    ....

    ' Everywhere in the code at least 1000 times:

    sql = "SELECT someField FROM someTable WHERE someField = " & SC & variable & SC

    Nice, isn't it?

    -- Gianluca Sartori

  • GabyYYZ (4/21/2010)


    Please tell me THIS doesn't happen a lot...*groan*.

    I hope it is just a joke....

    -Roy

  • Roy Ernest (4/21/2010)


    GabyYYZ (4/21/2010)


    Please tell me THIS doesn't happen a lot...*groan*.

    I hope it is just a joke....

    that's great

Viewing 15 posts - 14,611 through 14,625 (of 66,712 total)

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