<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Never Say Never &#187; T-SQL Challenges</title>
	<atom:link href="http://phelabaum.com/archive/tag/t-sql-challenges/feed/" rel="self" type="application/rss+xml" />
	<link>http://phelabaum.com</link>
	<description>MS SQL Server Development</description>
	<lastBuildDate>Thu, 29 Sep 2011 02:20:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>TSQL Challenge 25 Logic Testing</title>
		<link>http://phelabaum.com/archive/2010/04/tsql-challenge-25-logic-testing/</link>
		<comments>http://phelabaum.com/archive/2010/04/tsql-challenge-25-logic-testing/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 15:10:49 +0000</pubDate>
		<dc:creator>Seth Phelabaum</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Logic Testing]]></category>
		<category><![CDATA[T-SQL Challenges]]></category>

		<guid isPermaLink="false">http://phelabaum.com/archive/2010/04/tsql-challenge-25-logic-testing/</guid>
		<description><![CDATA[A week or so ago I asked Jacob Sebastian (Blog &#124; Twitter) if there was anything I could help him with in the monumental task he&#8217;s undertaken with the now bi-monthly T-SQL Challenges.&#160; He asked me to create some &#8216;Tricky&#8217; Data and do the logic testing setup for some of the challenges, starting with 25.&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>A week or so ago I asked Jacob Sebastian (<a href="http://beyondrelational.com/blogs/jacob/default.aspx" target="_blank">Blog</a> | <a href="http://twitter.com/jacobsebastian" target="_blank">Twitter</a>) if there was anything I could help him with in the monumental task he&#8217;s undertaken with the now bi-monthly <a href="http://beyondrelational.com/tc.aspx" target="_blank">T-SQL Challenges</a>.&#160; He asked me to create some &#8216;Tricky&#8217; Data and do the logic testing setup for some of the challenges, starting with 25.&#160; I agreed and started working on it.&#160; In my opinion, <a href="http://beyondrelational.com/blogs/tc/archive/2010/03/08/tsql-challenge-25-appointments-and-recurring-schedules.aspx" target="_blank">TSC25</a> was one of the most involved challenges to date.&#160; There were more things to take into account than any of the other recent challenges I can remember.&#160; Creating data for this was no different.&#160; Because there were so many different things to test for on this one, I&#8217;m sure there are still situations that this data doesn&#8217;t cover&#8230; but that&#8217;s OK.&#160; The logic testing isn&#8217;t really meant to cover <strong>every possible situation</strong> that could ever occur or cause something to fail, it&#8217;s just supposed to throw many different things at the solutions and see how they weather the storm. </p>
<p>I&#8217;ll admit, when I started, I was still way too hung up on the <a href="http://beyondrelational.com/blogs/tc/archive/2010/02/22/tsql-challenge-24-find-discrepancies-in-the-scheduled-activities-and-actual-activities-performed-by-employees.aspx" target="_blank">previous scheduling challenge</a> and kept thinking that the duration mattered.&#160; You can probably still see some of that in the logic testing data with some of the durations being very long.&#160; It wasn&#8217;t until well into the process of creating the data and generating the expected output that I finally got it through my head that the duration didn&#8217;t matter for this one.&#160; In any case, I think I covered quite a few of the extraneous situations allowed for by this challenge.&#160; </p>
<p>Here are some of the things covered by the logic testing: </p>
<ul>
<li>All basic types covered by the rules</li>
<li>Duplicate Task Names that occur on the same day</li>
<li>High values for Duration</li>
<li>Very High values for Val&#160; (Adding 255 years to a <strong>smalldatetime</strong> causes an overflow)</li>
<li>Unneeded values for Duration</li>
<li>Fairly Long Task Names(Should have made these longer, but even this length broke one solution)</li>
<li>Meetings with a Scheduled start date that didn&#8217;t match up to their recurring Schedule</li>
<li>Meetings with &gt; 1 year recurrence.</li>
<li>Meeting that only occurs one time at the exact end of its schedule time.</li>
<li>Meeting that starts at 00:00 </li>
<li>Meetings that could never occur</li>
<li>Meetings that would occur 1 minute past their schedule end date </li>
</ul>
<p>&#160;</p>
<p>A couple of the solutions were very close and only missed on one or two of those things.&#160; Remember that all of these challenges are ongoing and you can submit solutions at any time.&#160; Solutions submitted after the fact will be evaluated periodically, but you should run them through the all of the tests yourself to ensure that they pass before submitting them. </p>
]]></content:encoded>
			<wfw:commentRss>http://phelabaum.com/archive/2010/04/tsql-challenge-25-logic-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

