February 2, 2010 at 8:25 pm
Comments posted to this topic are about the item Multi-statement execution
February 2, 2010 at 11:05 pm
This was removed by the editor as SPAM
February 2, 2010 at 11:05 pm
I din't notice the concatenated "delete" statement and I gave wrong answer. Still I don't think it's a good question or at least it's not worth 2 points.
February 3, 2010 at 12:47 am
I think this is an excellent question. One must read through the script for starters, and catch the subtleties.
Secondly, there is a concatenation lesson to be learned concerning SQL Injection.
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
February 3, 2010 at 1:20 am
I think that this was a very good question. I certainly learned something from it. I was sure that the answer would be 0 and was surprised that I got it wrong. I’ve also noticed that unlike most times we didn’t get a link to any official site that explains this behavior, which brings me to the question - Is this behavior is documented and by design?
Adi
--------------------------------------------------------------
To know how to ask questions and increase the chances of getting asnwers:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
February 3, 2010 at 1:26 am
nice question.. thanks
February 3, 2010 at 1:58 am
Wel, Usualy I answer the question by reading it on the screen itself. I never copy and paste it in query analyzer.Had I copied it in query analyzer and read I would have definetly give right answer. Hence I dint feel it's a good question.
February 3, 2010 at 2:29 am
Tricky question, but not good for learning...good for dry run
February 3, 2010 at 2:32 am
Joy Smith San (2/3/2010)
Wel, Usualy I answer the question by reading it on the screen itself. I never copy and paste it in query analyzer.Had I copied it in query analyzer and read I would have definetly give right answer. Hence I dint feel it's a good question.
So good questions are only the ones you can answer???
February 3, 2010 at 3:32 am
Joy Smith San (2/3/2010)
Wel, Usualy I answer the question by reading it on the screen itself. I never copy and paste it in query analyzer.Had I copied it in query analyzer and read I would have definetly give right answer. Hence I dint feel it's a good question.
I don't understand how your reliance on reading the code in QA to get it right has any bearing on the question being good or not....:unsure: How would reading it in QA (I assume you do mean reading and not executing) have caused you to work out a different answer?
February 3, 2010 at 3:35 am
Interesting question - I guessed 0 rows - I thought that the dynamic SQL would execute and the results from the last statement - the delete statement would be inserted. Not really tried anything like this before - going to have a play with executing multiple statements in EXEC() and find out how it affects other things like @@rowcount as well.
February 3, 2010 at 3:37 am
Really This is not easy for sql newbies .Tricky question
But You Can Learn more knowledge by this
February 3, 2010 at 3:45 am
Simon Liddle (2/3/2010)
I thought that the dynamic SQL would execute and the results from the last statement - the delete statement would be inserted.
...and that is nonsense the more I think about it!
February 3, 2010 at 3:47 am
Ninja's_RGR'us (2/3/2010)
Joy Smith San (2/3/2010)
Wel, Usualy I answer the question by reading it on the screen itself. I never copy and paste it in query analyzer.Had I copied it in query analyzer and read I would have definetly give right answer. Hence I dint feel it's a good question.So good questions are only the ones you can answer???
I dint mean it. I mean to say, this question is just tricky.
Playing with words and nothing else.
February 3, 2010 at 3:55 am
Simon Liddle (2/3/2010)
Joy Smith San (2/3/2010)
Wel, Usualy I answer the question by reading it on the screen itself. I never copy and paste it in query analyzer.Had I copied it in query analyzer and read I would have definetly give right answer. Hence I dint feel it's a good question.I don't understand how your reliance on reading the code in QA to get it right has any bearing on the question being good or not....:unsure: How would reading it in QA (I assume you do mean reading and not executing) have caused you to work out a different answer?
Yes, you are right. I dont execute and just read it.
The difference is that, as you know when you copy it in QA color changes. I would have easily found that delete statement was a string appended to the insert statement.
Anyways, I was just saying my opinion. Hope I have the freedom to post what I feel, instead of simply praising always.
And yes, probably for a beginner it might be a good question. I agree.
Viewing 15 posts - 1 through 15 (of 46 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy