March 15, 2012 at 10:00 pm
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.
March 15, 2012 at 10:48 pm
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).
March 15, 2012 at 11:39 pm
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
March 16, 2012 at 1:00 am
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
March 16, 2012 at 1:22 am
Nice but tricky question.Thanks.
โWhen I hear somebody sigh, โLife is hard,โ I am always tempted to ask, โCompared to what?โโ - Sydney Harris
March 16, 2012 at 2:41 am
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...
March 16, 2012 at 3:15 am
This was removed by the editor as SPAM
March 16, 2012 at 3:51 am
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).
March 16, 2012 at 4:07 am
I get it right, but I do not like this kind of question.
๐
March 16, 2012 at 4:08 am
Good question, could get this one wrong easily ๐
M&M
March 16, 2012 at 4:28 am
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!
March 16, 2012 at 4:36 am
The correct answer is 'error at line 8', when you run out of disk space, so the closest answer is 'error at line 7'.
March 16, 2012 at 5:20 am
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
March 16, 2012 at 6:23 am
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