Hugo Kornelis (7/20/2010)
My final comment in this topic, and then I'll respect R.P.'s request.
Jeff Moden (7/19/2010)
Still, the order of run return is, in fact, documented in Books Online...
Specifies that in addition to the usual rows provided by GROUP BY, summary rows are introduced into the result set. Groups are summarized in a hierarchical order, from the lowest level in the group to the highest. The group hierarchy is determined by the order in which the grouping columns are specified. Changing the order of the grouping columns can affect the number of rows produced in the result set.
This quote describes which possible summary rows are and are not introduced in the result set, not the order in which results are returned.
(I'm also tempted to point out the use of the term "result set" rather than "recordset" in this quote, but the terminology in BOL as a whole is so often wrong that I'd probably better not go there)
Jeff, or anyone else - if you want to continue this debate, then please start a new topic and send me a PM with the link, or include the link in this topic. Without a link, I'll probably never find the new topic.
It's important that people on this thread realize that WITH ROLLUP and WITH CUBE produce the correct sorted results as stated in BOL. How much plainer can you get than Groups are summarized in a hierarchical order, from the lowest level in the group to the highest.
is pronounced ree-bar and is a Modenism for R
First step towards the paradigm shift of writing Set Based code: Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Helpful Links:
How to post code problemsHow to post performance problemsForum FAQs