Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12345»»»

Queries Expand / Collapse
Author
Message
Posted Wednesday, November 28, 2012 1:24 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 10:27 AM
Points: 3,302, Visits: 3,567
Koen Verbeeck (11/28/2012)
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.

+1


-------------------------------
Posting Data Etiquette - Jeff Moden
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
Post #1389557
Posted Wednesday, November 28, 2012 2:07 AM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Thursday, August 22, 2013 9:13 AM
Points: 496, Visits: 601
Sorry, no. 0 is the correct answer, as each element of this question is a statement, not a query.

As above, BOL defines a query as a request for data, not a request to set an environment variable.

Poor question today.


---

Note to developers:
CAST(SUBSTRING(CAST(FLOOR(NULLIF(ISNULL(COALESCE(1,NULL),NULL),NULL)) AS CHAR(1)),1,1) AS INT) == 1
So why complicate your code AND MAKE MY JOB HARDER??!

Want to get the best help? Click here http://www.sqlservercentral.com/articles/Best+Practices/61537/ (Jeff Moden)
My blog: http://uksqldba.blogspot.com
Visit http://www.DerekColley.co.uk to find out more about me.
Post #1389575
Posted Wednesday, November 28, 2012 2:14 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, January 16, 2013 10:02 AM
Points: 148, Visits: 70
I second guessed that the question meant statements as opposed to queries as otherwise it made no sense at all. I also second guessed that it wouldn't be 9 as I'd assumed so I ran a trace. I've been unable to capture the SET QUOTED_IDENTIFIER statement in a trace using SQL:stmtcompleted event at all. This applies whether I set it on or off, as part of a transaction or out of it, as part of a bunch of set statements or on its own. Even though I can't capture the statement, running it does have the expected impact. It may not have much in the way of practical implication but there is something interesting going on with the SET QUOTED_IDENTIFIER statement which the question has highlighted.
Post #1389578
Posted Wednesday, November 28, 2012 2:20 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 5:32 AM
Points: 1,805, Visits: 6,580
I didn't understand the question at all, so guessed. Having read the explanation I was none the wiser.
So I tried it, and the execution plan was empty.

confused.com
Post #1389582
Posted Wednesday, November 28, 2012 2:24 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 3:05 AM
Points: 1,777, Visits: 1,171
Koen Verbeeck (11/28/2012)
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.


QFT

Another +1 from me
Post #1389586
Posted Wednesday, November 28, 2012 2:51 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, October 16, 2014 10:02 AM
Points: 1,372, Visits: 1,566
Toreador (11/28/2012)
I didn't understand the question at all, so guessed. Having read the explanation I was none the wiser.
So I tried it, and the execution plan was empty.

confused.com


+1
Same was the case with me


~ 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 #1389599
Posted Wednesday, November 28, 2012 2:52 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 3:48 PM
Points: 4,111, Visits: 5,480
to be quite honest, i'm at a bit of a loss about what to make of this question.
I assumed the question meant statements and not queries, so traced it using profiler, for statement started.


____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Post #1389601
Posted Wednesday, November 28, 2012 3:37 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, August 27, 2013 4:28 AM
Points: 1,248, Visits: 779
Koen Verbeeck (11/28/2012)
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.

+1


Toreador (11/28/2012)
I didn't understand the question at all, so guessed. Having read the explanation I was none the wiser.
So I tried it, and the execution plan was empty.

confused.com

+1


_____________________________________________________________________
"The difficult tasks we do immediately, the impossible takes a little longer"
Post #1389616
Posted Wednesday, November 28, 2012 3:53 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 5:43 AM
Points: 1,945, Visits: 2,386
every person should be awarded +1 points who opted 0


_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #1389619
Posted Wednesday, November 28, 2012 3:54 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 1:19 AM
Points: 2,592, Visits: 2,446
The profiler shows Read 0
This is the most wrong and useless qotd in the history of ssc.
Post #1389623
« Prev Topic | Next Topic »

Add to briefcase ««12345»»»

Permissions Expand / Collapse