wildcards

  • In amongst all of the anguish over what the correct answer is we've missed the main issue here. It appears that Steve is a fan of Steppenwolf (either the band or the book they were named after - I'm guessing the former). Should we be concerned?

  • Steve Jones - SSC Editor (9/11/2013)


    My apologies for the error. the question was tested, but as I'm sure many of you have done, I made a change in production, altering the last name because I didn't like what was there.

    A few lessons here.

    1. regression test all changes

    2. don't fit your data types too tightly to the data. a varchar(50) or varchar(100) would have been a better choice and wouldn't alter the storage used.

    3. a little patience. Plenty of people pointed out the error. I don't award back points or change questions based on votes. I'll change it if it's incorrect.

    The question has been changed and points will be awarded back shortly.

    The answer is actually correct if ANSI_WARNINGS is set to OFF, the data gets smoothly (and truncated), and 2 rows are returned.

    As somebody said, most of those complaining, run the script before answering the question which is "cheating", so they shouldn't be rewarded for cheating.

    If you are giving points back, I want mine for the garbage collector's one from the other day, as when I answered there was no reference to sql 2012 there...

    Thanks for the question, by the way

  • Richard Warr (9/11/2013)


    In amongst all of the anguish over what the correct answer is we've missed the main issue here. It appears that Steve is a fan of Steppenwolf (either the band or the book they were named after - I'm guessing the former). Should we be concerned?

    Hardly! A classic band.

  • raulggonzalez (9/11/2013)


    Steve Jones - SSC Editor (9/11/2013)


    My apologies for the error. the question was tested, but as I'm sure many of you have done, I made a change in production, altering the last name because I didn't like what was there.

    A few lessons here.

    1. regression test all changes

    2. don't fit your data types too tightly to the data. a varchar(50) or varchar(100) would have been a better choice and wouldn't alter the storage used.

    3. a little patience. Plenty of people pointed out the error. I don't award back points or change questions based on votes. I'll change it if it's incorrect.

    The question has been changed and points will be awarded back shortly.

    The answer is actually correct if ANSI_WARNINGS is set to OFF, the data gets smoothly (and truncated), and 2 rows are returned.

    As somebody said, most of those complaining, run the script before answering the question which is "cheating", so they shouldn't be rewarded for cheating.

    If you are giving points back, I want mine for the garbage collector's one from the other day, as when I answered there was no reference to sql 2012 there...

    Thanks for the question, by the way

    I think I awarded back points for that one as well.

  • Steve Jones - SSC Editor (9/11/2013)


    raulggonzalez (9/11/2013)


    Steve Jones - SSC Editor (9/11/2013)


    My apologies for the error. the question was tested, but as I'm sure many of you have done, I made a change in production, altering the last name because I didn't like what was there.

    A few lessons here.

    1. regression test all changes

    2. don't fit your data types too tightly to the data. a varchar(50) or varchar(100) would have been a better choice and wouldn't alter the storage used.

    3. a little patience. Plenty of people pointed out the error. I don't award back points or change questions based on votes. I'll change it if it's incorrect.

    The question has been changed and points will be awarded back shortly.

    The answer is actually correct if ANSI_WARNINGS is set to OFF, the data gets smoothly (and truncated), and 2 rows are returned.

    As somebody said, most of those complaining, run the script before answering the question which is "cheating", so they shouldn't be rewarded for cheating.

    If you are giving points back, I want mine for the garbage collector's one from the other day, as when I answered there was no reference to sql 2012 there...

    Thanks for the question, by the way

    I think I awarded back points for that one as well.

    I still have it marked as incorrect. :ermm:

    Anyway the aim is to learn something (which I did as I was not aware of that new feature), not to get a point.

    Cheers

  • Steve Jones - SSC Editor (9/11/2013)


    raulggonzalez (9/11/2013)


    Steve Jones - SSC Editor (9/11/2013)


    My apologies for the error. the question was tested, but as I'm sure many of you have done, I made a change in production, altering the last name because I didn't like what was there.

    A few lessons here.

    1. regression test all changes

    2. don't fit your data types too tightly to the data. a varchar(50) or varchar(100) would have been a better choice and wouldn't alter the storage used.

    3. a little patience. Plenty of people pointed out the error. I don't award back points or change questions based on votes. I'll change it if it's incorrect.

    The question has been changed and points will be awarded back shortly.

    The answer is actually correct if ANSI_WARNINGS is set to OFF, the data gets smoothly (and truncated), and 2 rows are returned.

    As somebody said, most of those complaining, run the script before answering the question which is "cheating", so they shouldn't be rewarded for cheating.

    If you are giving points back, I want mine for the garbage collector's one from the other day, as when I answered there was no reference to sql 2012 there...

    Thanks for the question, by the way

    I think I awarded back points for that one as well.

    And I think it's still wrong, perpetuating a myth that calling that SP will get your files garbage collected straight away (which it usually won't be able to do). You fixed half the problem (added that it was 2012, not any earlier version) but didn't fix the other half.

    Tom

  • ChrisM@Work (9/11/2013)

    As Tom pointed out above, the last five or so questions have had errors which have made the choice of answer something of a lottery. But it's a game, it's not important enough to get upset over.

    I agree with you it`s kind of a game (I guess I am a bad loser :-)); but @ that time I was very upset that my answer was wrong for such an easy question (it should have been easy anyway)!

    Thanks & Best Regards,
    Hany Helmy
    SQL Server Database Consultant

  • raulggonzalez (9/11/2013)


    As somebody said, most of those complaining, run the script before answering the question which is "cheating", so they shouldn't be rewarded for cheating.

    If you are giving points back, I want mine for the garbage collector's one from the other day, as when I answered there was no reference to sql 2012 there...

    Thanks for the question, by the way

    Would everyone stop crying about it already? We are 10 pages in and counting. As with all QotDs, if you learned something new, great, if you didn't, well good for you for knowing it all anyway, what are you actually getting from the points anyway??? It's just a bit of working fun, if you don't like it, don't play.

    As for cheating, seriously? You research the question, you come to a conclusion, you test it, and you answer. If you don't believe in testing first, then you shouldn't work with databases. I wouldn't make changes to a production database without testing first, that would be stupid, testing is not the same as cheating.

  • I run on 2005 and the format of the insert statement with multiple values sections does not work for me. I had to recode it as separate insert statements and, of course, the one for Steppenwolf failed but the others succeeded so two rows were returned by the final select. I wondered whether the single insert statement would completely fail or take what it could. Reading the comments I understand that the whole statement fails. So while I got the answer the system was looking for (2) I know that the actual correct answer is 0.

  • crussell-931424 (9/11/2013)


    I knew it would error because I counted the length of all of the data and saw the one item at 11 characters. So I was surprised to see the answer. When I actually ran the code, sure enough it did error returning nothing. Now I'm confused. Was this run on some version of sql that allows it to work? Which one? If it was a mistake by the person that posted the question then I believe all of us who selected 0 should be marked as having entered the correct answer.

    Yes they did fix the error, and it appears as Correct Answer in my page.

    Thanks & Best Regards,
    Hany Helmy
    SQL Server Database Consultant

  • Toreador (9/11/2013)


    Dear Steve

    Can you change the points system so that if someone replies pointing out an error and 8 pages of people have already replied pointing out the same error in the same way, then instead of giving them an extra point, they instead have 10 points subtracted?

    Thanks in advance

    Everyone wants his point back, so they all post stating the error in the same way to get back their point; simple as that 😉

    Thanks & Best Regards,
    Hany Helmy
    SQL Server Database Consultant

  • Ross.M (9/11/2013)


    raulggonzalez (9/11/2013)


    As somebody said, most of those complaining, run the script before answering the question which is "cheating", so they shouldn't be rewarded for cheating.

    If you are giving points back, I want mine for the garbage collector's one from the other day, as when I answered there was no reference to sql 2012 there...

    Thanks for the question, by the way

    Would everyone stop crying about it already? We are 10 pages in and counting. As with all QotDs, if you learned something new, great, if you didn't, well good for you for knowing it all anyway, what are you actually getting from the points anyway??? It's just a bit of working fun, if you don't like it, don't play.

    As for cheating, seriously? You research the question, you come to a conclusion, you test it, and you answer. If you don't believe in testing first, then you shouldn't work with databases. I wouldn't make changes to a production database without testing first, that would be stupid, testing is not the same as cheating.

    Of course I don't run anything in a production database without testing it first, but come on, QotD is for testing yourself, making a research is usually what I do when I don't know the answer for sure. Copy/paste+F5 and select the right answer is cheating, period. 😀

    And as I said I don't do this for the points.

    Cheers

  • Great question idea, problem in the execution.

    I got it right by choosing 2, but sadly if there is a string truncation error and the results returned are 0 with the actual code run, then those people who chose 0 should get points. I would like to also keep my points for picking 2 (the clear intended answer), but only if those who chose 0 also get their points. Otherwise, give my points to them.

    Again, though, I think this is a great idea for a question, just should be tested carefully next time.

    - webrunner

    -------------------
    A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
    Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html

  • Stuart Davies (9/11/2013)


    ChrisM@Work (9/11/2013)


    Hany Helmy (9/11/2013)


    I am really amazed of the 16 people (as of now) who got it right! :w00t:

    Hope one of them will post a reply explaining how he got the result without throwing an error.

    Simple - always mark your answer before running the code. Any fool can run the code to get a QotD correct. Or not, in this case.

    You will learn far more from trying to figure out the answer and getting it wrong than running the code and getting it right.

    Agree - I never thought QOTD as being an exercise in copy and paste.

    Yes the code does throw an error when run however I get the following when running the script:-

    (1 row(s) affected)

    (1 row(s) affected)

    (1 row(s) affected)

    (1 row(s) affected)

    Msg 8152, Level 16, State 14, Line 7

    String or binary data would be truncated.

    The statement has been terminated.

    mychar

    ----------

    Steve

    Sterling

    (2 row(s) affected)

    +1

    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

  • Hi Steve - Kinda of a dirty trick changing the question...

    The question posed at the front page sets mychar to varchar(10) which would fail the batch insert so 0 is correct there.

    However, on the QOD page mychar is set to varchar(50) which results in 2 records returned...

    Any chance of some mercy since the questions did not match?

    Tom in Sacramento - For better, quicker answers on T-SQL questions, click on the following...http://www.sqlservercentral.com/articles/Best+Practices/61537/

Viewing 15 posts - 91 through 105 (of 145 total)

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