What will be the output of the following?

  • The increment is by 1, not -1, so the values would be -1,0,1.

  • There is something wrong with either question or with the answers.

  • I, too, am getting (-1, 0, 1). The question is flawed. Posting this to get my point for an incorrectly identified incorrect answer!

  • Point or no point (I selected -1,0,1 which I believe to be the correct answer) at least ensure that the question is legit before posting.

  • Gief one point.

  • kaspencer (6/28/2010)


    We all make mistakes, and we all forgive mistakes. But on a forum of this type we expect mistakes to be acknowledged by the moderators, and then corrected.

    Right. However, I just read through 7 pages of mostly repeated posts about what the correct answer is seeing if a mod had already addressed anything. At some point that stops being pointing out an issue so it's known and can be corrected and becomes whining that isn't productive in the least. If you forgive a mistake you don't keep telling someone that it's wrong as people have been doing here.

  • We can all see that to get the answer specified, the question should have read -1 and not 1. Does this really need to be repeated again?

  • and again

  • I too care about my points... but that's immaterial.

    I can confirm that the results will be -1,0,1 on SQL 2000, 2005, 2008 and 2008 R2 I didn't even need to run the code.

    Identity (seed, increment) was obviossly typoed.

    I picked the closest answer... -1,-0,1

    I seem to recall that you could get a -0 answer back in the old days of C, but maybe it was a different language.

    In either case, I like to look at my % of correct points and compare them to the group. It makes me feel as though I belong here. 🙂



    --Mark Tassin
    MCITP - SQL Server DBA
    Proud member of the Anti-RBAR alliance.
    For help with Performance click this link[/url]
    For tips on how to post your problems[/url]

  • In case anyone hasn't caught it yet, either question or the answer is wrong. If both the seed and increment are -1, then the answer would be -1, -2, -3. As written the answer is -1, 0, 1...

    or did someone else already mention this?

  • cfradenburg (6/28/2010)


    Right. However, I just read through 7 pages of mostly repeated posts about what the correct answer is seeing if a mod had already addressed anything. At some point that stops being pointing out an issue so it's known and can be corrected and becomes whining that isn't productive in the least. If you forgive a mistake you don't keep telling someone that it's wrong as people have been doing here.

    I can see what you're saying and I agree. I don't think that EVERYONE needs to point out just how wrong the answer (or question, depending on your perspective) is since it's been already stated in many ways over numerous posts.

    However, I also perceive that folks feel a need to post a comment here in order to get their points awarded. I don't know of anywhere that it's stated that a post is required if you answered a QOD correctly but points were not awarded. Perhaps that's where the confusion lies. I admit that I don't know the answer to that particular question, hence my own post just in case.

  • none of the options provided are correct for identity col(-1,1)

    the correct answer is (-1,0,1)

    Please check before you post.

    Thanks

  • What the heck!? Was it supposed to be identity (-1,-1)?

    I wrote it out in SQL and my server returns -1, 0, 1. What's the deal?

  • lbrigham (6/28/2010)


    or did someone else already mention this?

    :rolleyes:

    Aaron N. Cutshall (6/28/2010)


    However, I also perceive that folks feel a need to post a comment here in order to get their points awarded. I don't know of anywhere that it's stated that a post is required if you answered a QOD correctly but points were not awarded. Perhaps that's where the confusion lies. I admit that I don't know the answer to that particular question, hence my own post just in case.

    If points are awarded back, they are given to all who have answered the question. Even to those who chose an answer that everyone agrees to be incorrect. As I understand it, that is a limitation of the software; it can award points to everyone, but not to a selection.

    Your confusion comes from posters who claim they "post to get their point". That refers to the fact that every post made also awards a point. Not in the QotD category, but in the "Forum posters" category, as well as in the "Overall leaderboard". They compensate the loss of a point in one category by scoring a point in another category. And so, a system designed to encourase cinmmunity participation ends up resulting in numerous posts that once, a long time ago, when Compuserve still was an alive and kicking community, were mockingly referred to as "<aol>Me too!</aol>"

    srikantht.dev (6/28/2010)


    Please check before you post.

    <sigh>

    Please read the existing replies before you post.


    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/

  • Changing the subject somewhat...

    Although I knew that you can have negative seeds and increments for the IDENTITY property, I've never actually used them myself.

    I'd therefore be interested to hear if anyone else had used them, and in what sort of situations?

    Duncan

Viewing 15 posts - 61 through 75 (of 144 total)

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