Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Article Discussions
»
Article Discussions by Author
»
Discuss content posted by Dave62
»
Queries
61 posts, Page 1 of 7
1
2
3
4
5
»
»»
Queries
Rate Topic
Display Mode
Topic Options
Author
Message
Dave62
Dave62
Posted Tuesday, November 27, 2012 9:01 PM
UDP Broadcaster
Group: General Forum Members
Last Login: Today @ 8:58 AM
Points: 1,499,
Visits: 1,510
Comments posted to this topic are about the item
Queries
Post #1389492
Lokesh Vij
Lokesh Vij
Posted Tuesday, November 27, 2012 9:15 PM
Ten Centuries
Group: General Forum Members
Last Login: Today @ 1:02 AM
Points: 1,174,
Visits: 1,250
I was completely not able to get this question!
Could have been phrased better..
~ Lokesh Vij
Guidelines for quicker answers on T-SQL question
Guidelines for answers on Performance questions
Link to my Blog Post -->
www.SQLPathy.com
Follow me
@Twitter
Post #1389494
davoscollective
davoscollective
Posted Tuesday, November 27, 2012 9:58 PM
SSC-Addicted
Group: General Forum Members
Last Login: Today @ 6:24 PM
Points: 408,
Visits: 687
I guessed 7 and got it wrong.
I've just created a test database to try this.
Including actual execution plan shows nothing...
displaying estimated execution plan shows 8 queries, however, these 2 are counted as 1:
SET QUOTED_IDENTIFIER ON; SET ARITHABORT ON;
And both
BEGIN TRAN
and
COMMIT
are counted as queries in their own right. I suppose that's fair.
Interestingly, if you move QUOTED_IDENTIFIER to be the last one, estimated query plan counts it and COMMIT together as one query. I tried that hoping to see it say 9 queries but not what I expected at all. Seems like yet another quirk of the estimated query plan to me rather than being anything useful regarding the nature of the commands.
I hope someone can elaborate on this.
Post #1389503
kapil_kk
kapil_kk
Posted Tuesday, November 27, 2012 11:26 PM
Ten Centuries
Group: General Forum Members
Last Login: Sunday, May 19, 2013 11:16 PM
Points: 1,061,
Visits: 1,151
Not able to get the today's question
Post #1389517
okbangas
okbangas
Posted Tuesday, November 27, 2012 11:47 PM
Right there with Babe
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 3:36 AM
Points: 721,
Visits: 1,330
Well, this question definitely has more than one correct answer. If you look at the actual execution plan, the correct answer is 0.
Ole Kristian Velstadbråten Bangås -
Virinco
-
Facebook
-
Twitter
Concatenating Row Values in Transact-SQL
Post #1389521
Koen Verbeeck
Koen Verbeeck
Posted Wednesday, November 28, 2012 12:16 AM
SSCrazy Eights
Group: General Forum Members
Last Login: Today @ 6:51 AM
Points: 9,373,
Visits: 6,470
The only correct answer is 0.
There are 8
statements
in the estimated execution plan, but no queries.
From BOL:
A query is a request for data that is stored in SQL Server.
Query Fundamentals
There isn't a single statement in the batch that does a request for data, hence no queries.
How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
Member of
LinkedIn
. My blog at
LessThanDot
.
MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1389529
kapil_kk
kapil_kk
Posted Wednesday, November 28, 2012 12:19 AM
Ten Centuries
Group: General Forum Members
Last Login: Sunday, May 19, 2013 11:16 PM
Points: 1,061,
Visits: 1,151
I select 0 option but get it wrong...
Post #1389530
Rune Bivrin
Rune Bivrin
Posted Wednesday, November 28, 2012 12:23 AM
SSCrazy
Group: General Forum Members
Last Login: Yesterday @ 12:46 AM
Points: 2,657,
Visits: 719
That was ...
... interesting
Just because you're right doesn't mean everybody else is wrong.
Post #1389533
palotaiarpad
palotaiarpad
Posted Wednesday, November 28, 2012 12:29 AM
SSC Eights!
Group: General Forum Members
Last Login: Today @ 7:14 AM
Points: 847,
Visits: 322
And what shall we learn from that?
Post #1389537
Keld Laursen (VFL)
Keld Laursen (VFL)
Posted Wednesday, November 28, 2012 12:36 AM
SSC Veteran
Group: General Forum Members
Last Login: Today @ 7:36 AM
Points: 245,
Visits: 148
I agree with Koen. Those are statements. As the estimated execution plan doesn't know better it will divide this up into 8 parts. Why the quoted_identifier setting always will go with the next statement is beyond me, but is of no consequense for the answer.
As we have learned before, the estimated execution plan can lie to us, e.g. because of function calls. I would say that the actual execution plan is the only non-lying report of this query batch, and as stated previously, the actual number of queries against the engine is 0.
Post #1389542
« Prev Topic
|
Next Topic »
61 posts, Page 1 of 7
1
2
3
4
5
»
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.