|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 4:51 PM
Points: 32,923,
Visits: 26,811
|
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Sunday, March 17, 2013 12:31 AM
Points: 161,
Visits: 360
|
|
Very insightful article. Thanks. I have one question, how do you discard the output? (Anticipating a "slap-to-the-forehead" moment, but asking anyway...)
Best, Henk
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Today @ 9:39 AM
Points: 1,043,
Visits: 2,944
|
|
Sorry, but there's a glaring inconsistency in this article.
No-one with any taste buds would take a perfectly acceptable alcoholic drink and cool it so much that it freezes. From this I deduce that either what you've been eating all this time isn't really made from beer or there isn't really a secret formula, and you're stringing us all along.
Tut, tut, Mr Moden....
Semper in excretia, sumus solum profundum variat
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, August 06, 2012 11:54 AM
Points: 3,
Visits: 46
|
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 4:51 PM
Points: 32,923,
Visits: 26,811
|
|
Henk van den Berg (8/8/2011) Very insightful article. Thanks. I have one question, how do you discard the output? (Anticipating a "slap-to-the-forehead" moment, but asking anyway...)
Best, Henk
Heh... no problem, Henk. A lot of people miss it. In SQL Server 2005, start by selecting {Tools}{Options}{Query Results}{Results to Grid}. Then, click the {Discard results after execution} check box. In 2005, you may have to open a new query window in SSMS before the setting takes affect. In 2008, (IIRC) the setting is good for the current window and any new windows you open while the box is checked.

--Jeff Moden "RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".
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."
For better, quicker answers on T-SQL questions, click on the following... 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/
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 4:51 PM
Points: 32,923,
Visits: 26,811
|
|
majorbloodnock (8/8/2011)
Sorry, but there's a glaring inconsistency in this article. No-one with any taste buds would take a perfectly acceptable alcoholic drink and cool it so much that it freezes. From this I deduce that either what you've been eating all this time isn't really made from beer orthere isn't really a secret formula, and you're stringing us all along.Tut, tut, Mr Moden.... 
Heh... because I like American mass-produced beer in pop-top cans, some would say that I, indeed, have no taste buds.
--Jeff Moden "RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".
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."
For better, quicker answers on T-SQL questions, click on the following... 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/
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 4:51 PM
Points: 32,923,
Visits: 26,811
|
|
George J Verras (8/8/2011) Excellent, Thanks Jeff!
You bet, George. Thanks for stopping by and for the feedback.
--Jeff Moden "RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".
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."
For better, quicker answers on T-SQL questions, click on the following... 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/
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Friday, April 19, 2013 11:06 AM
Points: 174,
Visits: 423
|
|
Greetings Jeff,
That was a wonderful and very insightful article about rCTE's and ways to count out of the box. I will have to put some of the pseudo-counters into practice in my scripts.
Thank you for sharing.
P.S.
Beer popsicles are possible if you know the *secret* ingredient to mix to make it become solid. 
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Tuesday, January 15, 2013 11:11 AM
Points: 1,945,
Visits: 2,782
|
|
This was really good. I was surprised that the WHILE loop did so better than the rCTE. I was expecting the loop to be a bit better because it does not have to touch a table except to write an integer, but I expected the optimizer to turn the rCTE into a loop.
Books in Celko Series for Morgan-Kaufmann Publishing Analytics and OLAP in SQL Data and Databases: Concepts in Practice Data, Measurements and Standards in SQL SQL for Smarties SQL Programming Style SQL Puzzles and Answers Thinking in Sets Trees and Hierarchies in SQL
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, February 12, 2013 7:00 AM
Points: 9,
Visits: 13
|
|
|
|
|