Are the posted questions getting worse?

  • LOL just got this message from a Facebook friend. "While working on a SQL statement just now I ran into an issue that I needed a little help to solve. I search for my issue, found similar question and the solution and began to implement the recommendation. The avatar of the person who solved the issue caught my attention and when I glanced over I saw a familiar name. Thanks for the help, six years after your original post :)"

    Nice to know that this stuff still helps people.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Sometimes you have to wonder about people writing SQL code and this is just one example.  I am currently working through some code here at work that simply confirms that some people should not be allowed to write SQL code without proper supervision.

  • Lynn Pettis - Friday, June 9, 2017 12:44 PM

    Sometimes you have to wonder about people writing SQL code and this is just one example.  I am currently working through some code here at work that simply confirms that some people should not be allowed to write SQL code without proper supervision.

    I came across this little gem to generate a datestamp in dos, this can be done in one easy to understand line and I have no idea what this is actually doing.  My only theory is that whoever created it bashed their head onto their keyboard until this happened.

    for /F "tokens=2,3,4 delims=/ " %%i in ('date/t') do set y=%%k
    for /F "tokens=2,3,4 delims=/ " %%i in ('date/t') do set d=%%k%%i%%j
    for /F "tokens=5-8 delims=:. " %%i in ('echo.^| time ^| find "current" ') do set t=%%i%%j
    set t=%t%_
    if "%t:~3,1%"=="_" set t=0%t%
    set t=%t:~0,4%
    set "theFilename=%d%_%1%"
    echo %theFilename%

  • ZZartin - Friday, June 9, 2017 12:53 PM

    Lynn Pettis - Friday, June 9, 2017 12:44 PM

    Sometimes you have to wonder about people writing SQL code and this is just one example.  I am currently working through some code here at work that simply confirms that some people should not be allowed to write SQL code without proper supervision.

    I came across this little gem to generate a datestamp in dos, this can be done in one easy to understand line and I have no idea what this is actually doing.  My only theory is that whoever created it bashed their head onto their keyboard until this happened.

    for /F "tokens=2,3,4 delims=/ " %%i in ('date/t') do set y=%%k
    for /F "tokens=2,3,4 delims=/ " %%i in ('date/t') do set d=%%k%%i%%j
    for /F "tokens=5-8 delims=:. " %%i in ('echo.^| time ^| find "current" ') do set t=%%i%%j
    set t=%t%_
    if "%t:~3,1%"=="_" set t=0%t%
    set t=%t:~0,4%
    set "theFilename=%d%_%1%"
    echo %theFilename%

    I'm versed in DOS, but like you, I think someone did a lot of copy/paste they didn't understand.  Or, maybe they went so far down a rabbit hole that this is all that was left by the time they came back up.

  • Lynn Pettis - Friday, June 9, 2017 12:44 PM

    Sometimes you have to wonder about people writing SQL code and this is just one example.  I am currently working through some code here at work that simply confirms that some people should not be allowed to write SQL code without proper supervision.

    Heh, you're so  funny. 🙂
    Can you guess the name of the vendor of this piece of code?
    IF (@step_id <= @max_step_id)
      BEGIN
      UPDATE msdb.dbo.sysjobsteps
      SET step_id = step_id + 1
      WHERE (step_id >= @step_id)
       AND (job_id = @job_id)

      -- Clean up OnSuccess/OnFail references
      UPDATE msdb.dbo.sysjobsteps
      SET on_success_step_id = on_success_step_id + 1
      WHERE (on_success_step_id >= @step_id)
       AND (job_id = @job_id)

      UPDATE msdb.dbo.sysjobsteps
      SET on_fail_step_id = on_fail_step_id + 1
      WHERE (on_fail_step_id >= @step_id)
       AND (job_id = @job_id)

      UPDATE msdb.dbo.sysjobsteps
      SET on_success_step_id = 0,
        on_success_action = 1 -- Quit With Success
      WHERE (on_success_step_id = @step_id)
       AND (job_id = @job_id)

      UPDATE msdb.dbo.sysjobsteps
      SET on_fail_step_id = 0,
        on_fail_action = 2  -- Quit With Failure
      WHERE (on_fail_step_id = @step_id)
       AND (job_id = @job_id)
      END

    I bet you can.
    It seems the developer you referenced was "learning from the masters".

    _____________
    Code for TallyGenerator

  • Lynn Pettis - Friday, June 9, 2017 12:44 PM

    Sometimes you have to wonder about people writing SQL code and this is just one example.  I am currently working through some code here at work that simply confirms that some people should not be allowed to write SQL code without proper supervision.

    <dramatic sigh> I wish people would quit talking about my code. :hehe:

    Truth, that isn't my code, but some days I do tend to over engineer stuff because I get wrapped up in the user's "Dragon Poker" business rules.

    EDIT: Added URL to reference.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Sergiy - Sunday, June 11, 2017 5:17 PM

    Can you guess the name of the vendor of this piece of code?
    IF (@step_id <= @max_step_id)
      BEGIN
      UPDATE msdb.dbo.sysjobsteps
      SET step_id = step_id + 1
      WHERE (step_id >= @step_id)
       AND (job_id = @job_id)

      -- Clean up OnSuccess/OnFail references
      UPDATE msdb.dbo.sysjobsteps
      SET on_success_step_id = on_success_step_id + 1
      WHERE (on_success_step_id >= @step_id)
       AND (job_id = @job_id)

      UPDATE msdb.dbo.sysjobsteps
      SET on_fail_step_id = on_fail_step_id + 1
      WHERE (on_fail_step_id >= @step_id)
       AND (job_id = @job_id)

      UPDATE msdb.dbo.sysjobsteps
      SET on_success_step_id = 0,
        on_success_action = 1 -- Quit With Success
      WHERE (on_success_step_id = @step_id)
       AND (job_id = @job_id)

      UPDATE msdb.dbo.sysjobsteps
      SET on_fail_step_id = 0,
        on_fail_action = 2  -- Quit With Failure
      WHERE (on_fail_step_id = @step_id)
       AND (job_id = @job_id)
      END

    I bet you can.
    It seems the developer you referenced was "learning from the masters".

    I confess to cluelessness on this one. If no one else gets it right, will you reveal the answer?

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Brandie Tarvin - Monday, June 12, 2017 4:17 AM

    I confess to cluelessness on this one. If no one else gets it right, will you reveal the answer?

    Oh, you must be kidding me.
    It's so easy:
    sp_helptext 'msdb.[dbo].[sp_add_jobstep_internal]'

    _____________
    Code for TallyGenerator

  • Sergiy - Sunday, June 11, 2017 5:17 PM

    Lynn Pettis - Friday, June 9, 2017 12:44 PM

    Sometimes you have to wonder about people writing SQL code and this is just one example.  I am currently working through some code here at work that simply confirms that some people should not be allowed to write SQL code without proper supervision.

    Heh, you're so  funny. 🙂
    Can you guess the name of the vendor of this piece of code?
    IF (@step_id <= @max_step_id)
      BEGIN
      UPDATE msdb.dbo.sysjobsteps
      SET step_id = step_id + 1
      WHERE (step_id >= @step_id)
       AND (job_id = @job_id)

      -- Clean up OnSuccess/OnFail references
      UPDATE msdb.dbo.sysjobsteps
      SET on_success_step_id = on_success_step_id + 1
      WHERE (on_success_step_id >= @step_id)
       AND (job_id = @job_id)

      UPDATE msdb.dbo.sysjobsteps
      SET on_fail_step_id = on_fail_step_id + 1
      WHERE (on_fail_step_id >= @step_id)
       AND (job_id = @job_id)

      UPDATE msdb.dbo.sysjobsteps
      SET on_success_step_id = 0,
        on_success_action = 1 -- Quit With Success
      WHERE (on_success_step_id = @step_id)
       AND (job_id = @job_id)

      UPDATE msdb.dbo.sysjobsteps
      SET on_fail_step_id = 0,
        on_fail_action = 2  -- Quit With Failure
      WHERE (on_fail_step_id = @step_id)
       AND (job_id = @job_id)
      END

    I bet you can.
    It seems the developer you referenced was "learning from the masters".

    You know what, MS is MS and from what I can tell their developers aren't coming here to ask questions.

  • Sergiy - Monday, June 12, 2017 6:44 AM

    Brandie Tarvin - Monday, June 12, 2017 4:17 AM

    I confess to cluelessness on this one. If no one else gets it right, will you reveal the answer?

    Oh, you must be kidding me.
    It's so easy:
    sp_helptext 'msdb.[dbo].[sp_add_jobstep_internal]'

    And sarcasm must be a foreign language to you.  :hehe:

  • As part of my Grace Hopper SOL session, I'm committed to naming the different types of database platforms and it occurs to me that I know of a few off the top of my head: SQL Server, Oracle, NoSQL, MySQL, and DB2.

    Any others that I'm missing?

    I only have about 10 minutes to lay out what types of DB administrators there are, mention the different platforms, and explain why databases are so important to modern life before giving 10 minutes of questions and give and take on the session (each one only lasts 20 minutes), so I have to be brief. Any thoughts you'd like me to incorporate into this?

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Brandie Tarvin - Tuesday, June 13, 2017 5:01 AM

    As part of my Grace Hopper SOL session, I'm committed to naming the different types of database platforms and it occurs to me that I know of a few off the top of my head: SQL Server, Oracle, NoSQL, MySQL, and DB2.

    Any others that I'm missing?

    I only have about 10 minutes to lay out what types of DB administrators there are, mention the different platforms, and explain why databases are so important to modern life before giving 10 minutes of questions and give and take on the session (each one only lasts 20 minutes), so I have to be brief. Any thoughts you'd like me to incorporate into this?

    There's PostGreSQL[/url].


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    —Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • Brandie Tarvin - Tuesday, June 13, 2017 5:01 AM

    As part of my Grace Hopper SOL session, I'm committed to naming the different types of database platforms and it occurs to me that I know of a few off the top of my head: SQL Server, Oracle, NoSQL, MySQL, and DB2.

    Any others that I'm missing?

    I only have about 10 minutes to lay out what types of DB administrators there are, mention the different platforms, and explain why databases are so important to modern life before giving 10 minutes of questions and give and take on the session (each one only lasts 20 minutes), so I have to be brief. Any thoughts you'd like me to incorporate into this?

    Given the limited time you have, I'd suggest starting with explaing the difference between "relational" databases (such as SQL Server, Oracle, PostgreSQL, MySQL, DB2), that have a strong schema and strong ACID guarantees; versus the so-callled "NoSQL" databases (for which I'll let someone else chime in with examples because I don't know which are big at this time) that are typically schema-free and have various degrees of looseness on the ACID properties.
    Both these two types have their uses. The mistake is to try to think that one type can do the work of both. They CAN but you SHOULDN'T. (Just as you CAN clip your nails with a hedge trimmer or trim your hedge with a nailclipper, but most people would prefer to have one of each).
    As to why databases are important in modern life: They are not. Data is important. How much data do we collect now as opposed to some decades ago? How is that data used to support our life (decision making, but also leasure - just think about all the statistics in sports broadcasts if you want an example from outside of the boardroom), nd how long arre we prepared to wait for that data. The database is just a tool to support this.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/

  • Brandie Tarvin - Tuesday, June 13, 2017 5:01 AM

    As part of my Grace Hopper SOL session, I'm committed to naming the different types of database platforms and it occurs to me that I know of a few off the top of my head: SQL Server, Oracle, NoSQL, MySQL, and DB2.

    Any others that I'm missing?

    I only have about 10 minutes to lay out what types of DB administrators there are, mention the different platforms, and explain why databases are so important to modern life before giving 10 minutes of questions and give and take on the session (each one only lasts 20 minutes), so I have to be brief. Any thoughts you'd like me to incorporate into this?

    Types of platforms I'd go different:
    Relational, Object, ID/Value, Unstructured, Semi-structured

    What you have is kind of a mix between products & platforms, NoSQL being more of a platform than the products you listed, SQL Server Oracle MySQL & DB2.

    "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

  • I'd agree with Grant and Hugo, rather than getting down to individual RDBMS systems, think 1000ft view, especially with the limited timeframe for the presentation.  Think "explaining to the CXX Executives," rather than "explaining to the techies."

Viewing 15 posts - 58,891 through 58,905 (of 66,712 total)

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