Looping

  • Comments posted to this topic are about the item Looping

  • Seriously?

    These type of errors I used to do when I learn looping.

    Never the less +1 to me.

    Thanks for the very easy question.

  • Whilst it might take a while, eventually you will get an error when you run out of disk space. So, I kinda think that the correct answer is most likely that you will get an error at line 8 (the INSERT statement).

  • You're presuming I will stop the execution. :hehe:

    But assuming I do stop execution:

    The answer depends on how you measure your results.

    At the end of running the code and after stopping the execution my transaction remains open.

    If I then commit the transaction I get the result you described.

    However if I roll it back I don't get any records.

    Or am I to assume that the commit transaction line in the code provided was to be executed after execution was stopped?

    edit: I assumed read committed, perhaps I shouldn't have

  • Easy point for me on Friday. :w00t:

    However, any answer containing the word "unlimited" is wrong by default.

    ps: do not test this in production! ๐Ÿ˜€

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Nice but tricky question.Thanks.

    โ€œWhen I hear somebody sigh, โ€˜Life is hard,โ€™ I am always tempted to ask, โ€˜Compared to what?โ€™โ€ - Sydney Harris

  • happycat59 (3/15/2012)


    Whilst it might take a while, eventually you will get an error when you run out of disk space. So, I kinda think that the correct answer is most likely that you will get an error at line 8 (the INSERT statement).

    Yes, run the code and see what error you REALLY do get...

  • This was removed by the editor as SPAM

  • I got this one wrong despite knowing what the "correct" answer was, because I elected to treat the word unlimited literally. You will get an error unless you've got unlimited disk space (which would be nice).

  • I get it right, but I do not like this kind of question.

    ๐Ÿ˜Ž

  • Good question, could get this one wrong easily ๐Ÿ™‚

    M&M

  • I agree that the answer was one of the last two, and although I got it right by elimination (I figured you were testing the looping logic rather than "unlimited" options) I think with the wording of the questions the error is probably more correct.

    You will always error if you don't stop the query once you run out of disc space! You will need to run the Commit (which isn't mentioned) to have all the values of 1 maintained in the DB!

  • The correct answer is 'error at line 8', when you run out of disk space, so the closest answer is 'error at line 7'.

  • Easy point to end the week on - thanks

    -------------------------------Posting Data Etiquette - Jeff Moden [/url]Smart way to ask a question
    There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. โ€• Carl Sagan
    I would never join a club that would allow me as a member - Groucho Marx

  • Thanks for the question. It's nice to see questions from newer people. While I always appreciate the questions posted by the mainstay contributors to the site, it's good to see new participants as well.

    [font="Verdana"]Please don't go. The drones need you. They look up to you.[/font]
    Connect to me on LinkedIn

Viewing 15 posts - 1 through 15 (of 49 total)

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