<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>devrobboek - Latest Comments in FizzBuzz in T-SQL</title><link>http://devrobboek.disqus.com/</link><description>None</description><atom:link href="https://devrobboek.disqus.com/fizzbuzz_in_t_sql/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Thu, 02 Apr 2009 14:13:35 -0000</lastBuildDate><item><title>Re: FizzBuzz in T-SQL</title><link>http://dev.robboek.com/2009/02/03/fizzbuzz-in-t-sql/#comment-16108105</link><description>&lt;p&gt;if (@n1 != 0 and @n2 != 0) not required though&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Amit</dc:creator><pubDate>Thu, 02 Apr 2009 14:13:35 -0000</pubDate></item><item><title>Re: FizzBuzz in T-SQL</title><link>http://dev.robboek.com/2009/02/03/fizzbuzz-in-t-sql/#comment-16108104</link><description>&lt;p&gt;declare @num	int,&lt;br&gt;	@n1	int,&lt;br&gt;	@n2	int&lt;br&gt;set @num = 1&lt;/p&gt;&lt;p&gt;while(@num &amp;lt; = 100)&lt;br&gt;begin&lt;/p&gt;&lt;p&gt;	select @n1 = (@num%3)&lt;br&gt;	select @n2 = (@num%5)&lt;/p&gt;&lt;p&gt;	if (@n1 = 0)&lt;br&gt;	if (@n1 = 0 and @n2 = 0)&lt;br&gt;		Print 'FizzBuzz'&lt;br&gt;	else&lt;br&gt;		Print 'Fizz'&lt;br&gt;	if (@n1 != 0 and @n2 = 0)&lt;br&gt;	Print 'Buzz'&lt;br&gt;	else&lt;br&gt;	if (@n1 != 0 and @n2 != 0)&lt;br&gt;	Print @num 	&lt;br&gt;set @num = @num + 1&lt;br&gt;end&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Amit</dc:creator><pubDate>Thu, 02 Apr 2009 14:12:05 -0000</pubDate></item><item><title>Re: FizzBuzz in T-SQL</title><link>http://dev.robboek.com/2009/02/03/fizzbuzz-in-t-sql/#comment-16108103</link><description>&lt;p&gt;That would be because the default MAXRECURSION is 100. If you want to go above that, add &lt;em&gt;OPTION(MAXRECURSION 102)&lt;/em&gt; after the ORDER BY clause. You can use 0 for unlimited, but be careful.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Rob Boek</dc:creator><pubDate>Thu, 05 Feb 2009 08:38:08 -0000</pubDate></item><item><title>Re: FizzBuzz in T-SQL</title><link>http://dev.robboek.com/2009/02/03/fizzbuzz-in-t-sql/#comment-16108101</link><description>&lt;p&gt;Rob,&lt;/p&gt;&lt;p&gt;This also shows another thing. The CTE is recursive in nature. So what we really have here is an example of using recursion.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Scott Turner</dc:creator><pubDate>Thu, 05 Feb 2009 00:08:20 -0000</pubDate></item><item><title>Re: FizzBuzz in T-SQL</title><link>http://dev.robboek.com/2009/02/03/fizzbuzz-in-t-sql/#comment-16108100</link><description>&lt;p&gt;Rob,&lt;/p&gt;&lt;p&gt;This doesn't seem to scale well.&lt;/p&gt;&lt;p&gt;When I change the where clause to "WHERE Number &amp;lt; 102", I get:&lt;/p&gt;&lt;p&gt;"The statement terminated. The maximum recursion 100 has been exhausted before statement completion."&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Scott Turner</dc:creator><pubDate>Thu, 05 Feb 2009 00:01:49 -0000</pubDate></item><item><title>Re: FizzBuzz in T-SQL</title><link>http://dev.robboek.com/2009/02/03/fizzbuzz-in-t-sql/#comment-16108099</link><description>&lt;p&gt;This reminds us how hard is is to keep your mind on SET BASED all the time.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Rhys</dc:creator><pubDate>Tue, 03 Feb 2009 14:42:47 -0000</pubDate></item><item><title>Re: FizzBuzz in T-SQL</title><link>http://dev.robboek.com/2009/02/03/fizzbuzz-in-t-sql/#comment-16108098</link><description>&lt;p&gt;Nice&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Pinal Dave</dc:creator><pubDate>Tue, 03 Feb 2009 14:28:25 -0000</pubDate></item></channel></rss>