|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Today @ 1:54 AM
Points: 2,475,
Visits: 2,135
|
|
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 FundamentalsThere 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
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Today @ 8:19 AM
Points: 496,
Visits: 584
|
|
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.
|
|
|
|
|
SSC-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.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 9:52 AM
Points: 1,356,
Visits: 4,761
|
|
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
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 2:26 AM
Points: 1,084,
Visits: 690
|
|
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 FundamentalsThere isn't a single statement in the batch that does a request for data, hence no queries.
QFT
Another +1 from me
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Today @ 1:02 AM
Points: 1,174,
Visits: 1,250
|
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: 2 days ago @ 3:48 AM
Points: 3,125,
Visits: 4,311
|
|
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”
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Today @ 9:35 AM
Points: 1,163,
Visits: 729
|
|
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 FundamentalsThere 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"
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Sunday, May 19, 2013 11:16 PM
Points: 1,061,
Visits: 1,151
|
|
| every person should be awarded +1 points who opted 0
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Today @ 1:51 AM
Points: 1,971,
Visits: 1,821
|
|
The profiler shows Read 0 This is the most wrong and useless qotd in the history of ssc.
|
|
|
|