What will be the output of the following?

  • One of the conclusions of todays question is that a lot of people participate in the QotD and in the discussion. I think that's a good sign.

    Vera

  • The question in the e-mail shows a different step value than the one on the site (1 in the e-mail, -1 on the site). Both -1,-2,-3 and -1,0,1 should be correct answers.

  • I haven't read all the posts... way too many :w00t:

    But it appears the question and/or answer has changed since the newsletter has been releases. The newsletter has identity(-1,1) which would make the answer -1,0,1. The web site now shows identity(-1,-1) which would make the answer -1,-2,-3. I selected this answer but I'm told I'm wrong, the answer really should be -1,0,1.

    Here is the question when I answered:

    Create Table MyTable

    (

    mainkey int not null identity (-1,-1)

    )

    GO

    insert into MyTable default values

    insert into MyTable default values

    insert into MyTable default values

    Select * from MyTable

    So, I would venture to say the question and/answer needs to be reviewed and corrected.

    David

  • I just jumped in to answer the question and on the site it shows "mainkey int not null identity (-1,-1)" which should yield -1, -2, -3 yet I'm told the correct answer should be -1, -0, 1. Now I see many pages of posts where the question must have been "mainkey int not null identity (-1,1)" but that's not how it shows now. Frustrating.;-)

  • Sorry, I corrected the answer and question, so it was incorrect again. It has been fixed.

    This happens, it's human error, and all I can do is award back points and apologize.

  • Those "trick" QotD are frustrating, but the good discussion that follows illustrates the real value of the community here. This was clearly a human error (it happens). The takeaway may not be a revelation about the identity column, but a lesson on proofing. Also a lesson on community-supported content creation.

    One of my first posts here ripped on what I assumed was a paid professional author. The quality of articles is consistently high enough to make that mistake. Once I learned that the articles are written by our community, I realized that if I am unwilling to put up then I should shut up. 🙂 Actually, I have been contributing more since I realized this site is crowd-sourced articles (haven't submitted an article yet though)

    Anyway, I wanted to thank the author for submitting the question. I wanted to thank those that participated in posting - and remind everyone to imagine themselves receiving feedback on a simple mistake if/when they ever submit a question or an article.

    that's all... have a nice day.

  • I don't know if I'll get my point, and I don't rightly care. Site showed mainkey int not null identity (-1,-1), I chose -1,-2,-3 and was told wrong. I got all my confirmation that I in fact chose the right answer by all the prior posts even though it was really one of two 'correct' answers. A checkbox on this would have made it a bit more interesting.

    If in my spare time I have the time, I have a question I am now thinking of. Unfortunately it might be better posted as a puzzle.

    I like single answer checkbox questions. Make them second guess those other options.

    Cheers,

    Tim

  • Me again.

    Maybe I'll take my half point. The more I think about the more I am starting to think that QotD should be treated much the same as new software releases. Wait until ver. 2 is released before using in a production environment. At that point the software/question should be a bit more stable.

    I appreciate all the questions posed over the past 7 years. Thank you to all those better than I.

    Tim

    If you needed me to put a smiley face in my message I am sorry my humor wasn't obvious.

  • The creditability index value is dropping. Red alert.;-)

  • The creditability index value is dropping. Red alert.;-)

  • The question in the e-mail does not match the question on the web page.

  • Sorry if this was already covered. I did read through the 11 pages :doze: and didn't see much on the subject of sort order. Without a specified order wouldn't -3, -2, -1 also be a correct answer?

  • It could be. Good catch, Kevin.

  • I think Hugo Kornelis pointed it out on page #4, but it was at the end of a lengthy post so perhaps easy to miss.

  • paul.knibbs (6/28/2010)


    I think Hugo Kornelis pointed it out on page #4, but it was at the end of a lengthy post so perhaps easy to miss.

    Yup it's been pointed out 2-3 times already. Now that the tsunami is over I can finally subscribe to the thread. 😉

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

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