Ooooo, be careful. Using rCTEs to count is as bad as or worse than any While loop to accomplish the same thing. They're real resource hogs, to boot. Please see the following article before you even think of using an rCTE that counts or does similar RBAR things. And, yeah... it's RBAR as you'll see in the article.
commented on May 22 2014 12:58AM