<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.2" -->
<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/"
	>

<channel>
	<title>facility9</title>
	<link>http://facility9.com</link>
	<description>ruminations on sql, ruby, c# and other things</description>
	<pubDate>Mon, 28 Jul 2008 20:05:33 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
	<language>en</language>
			<item>
		<title>Missing cookies in jQuery AJAX callbacks?</title>
		<link>http://facility9.com/2008/07/28/missing-cookies-in-jquery-ajax-callbacks/</link>
		<comments>http://facility9.com/2008/07/28/missing-cookies-in-jquery-ajax-callbacks/#comments</comments>
		<pubDate>Mon, 28 Jul 2008 20:05:33 +0000</pubDate>
		<dc:creator>jeremiah</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://facility9.com/2008/07/28/missing-cookies-in-jquery-ajax-callbacks/</guid>
		<description><![CDATA[For my current project, we&#8217;re making use of a large number of jQuery AJAX callbacks, as well as cookies, to deliver some rich functionality to the users of a web site.  Unfortunately this created a little bit of an issue when trying get this to work in IE7.
Here&#8217;s what I originally attempted:

function do_something() {
&#160;&#160;$.ajax({
&#160;&#160;&#160;&#160;url: [...]]]></description>
			<content:encoded><![CDATA[<p>For my current project, we&#8217;re making use of a large number of jQuery AJAX callbacks, as well as cookies, to deliver some rich functionality to the users of a web site.  Unfortunately this created a little bit of an issue when trying get this to work in IE7.</p>
<p>Here&#8217;s what I originally attempted:</p>
<p><code><br />
function do_something() {<br />
&nbsp;&nbsp;$.ajax({<br />
&nbsp;&nbsp;&nbsp;&nbsp;url: 'http://example.com/AjaxRocks',<br />
&nbsp;&nbsp;&nbsp;&nbsp;type: 'POST',<br />
&nbsp;&nbsp;&nbsp;&nbsp;dataype: 'json',<br />
&nbsp;&nbsp;&nbsp;&nbsp;success: success_response<br />
&nbsp;&nbsp;});<br />
}<br />
function success_response(json) {<br />
&nbsp;&nbsp;var cookie_data = load_data_from_cookie(); // the implementation of this is not important<br />
&nbsp;&nbsp;// unfortunately, cookie_data is null so this doesn't really give us the important cookie_data<br />
}<br />
</code></p>
<p>For some reason, the full contents of document.cookie are not available from inside the success_response function call.  The solution?  Load the cookie&#8217;d data before making the AJAX call:</p>
<p><code><br />
function do_something() {<br />
&nbsp;&nbsp;var cookie_data = load_data_from_cookie();<br />
&nbsp;&nbsp;$.ajax({<br />
&nbsp;&nbsp;&nbsp;&nbsp;url: 'http://example.com/AjaxRocks',<br />
&nbsp;&nbsp;&nbsp;&nbsp;type: 'POST',<br />
&nbsp;&nbsp;&nbsp;&nbsp;dataype: 'json',<br />
&nbsp;&nbsp;&nbsp;&nbsp;success: function(json) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;success_response(json, cookie_data);<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;});<br />
}<br />
function success_response(json, cookie_data) {<br />
&nbsp;&nbsp;// do something successful<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://facility9.com/2008/07/28/missing-cookies-in-jquery-ajax-callbacks/feed/</wfw:commentRss>
		</item>
		<item>
		<title>IE7, dropdowns, and z-index</title>
		<link>http://facility9.com/2008/07/17/ie7-dropdowns-and-z-index/</link>
		<comments>http://facility9.com/2008/07/17/ie7-dropdowns-and-z-index/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 15:18:55 +0000</pubDate>
		<dc:creator>jeremiah</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[hackery]]></category>

		<category><![CDATA[ie7]]></category>

		<guid isPermaLink="false">http://facility9.com/2008/07/17/ie7-dropdowns-and-z-index/</guid>
		<description><![CDATA[I spent most of yesterday and most of this morning battling with a IE7 display bug.
Back story: we are using jQuery&#8217;s superfish drop down menus (a jQuery based implement of suckerfish/son of suckerfish) for site navigation.  Everything works great in Firefox 2/3 and Safari.  I&#8217;m going to assume that IE6 looks great as [...]]]></description>
			<content:encoded><![CDATA[<p>I spent most of yesterday and most of this morning battling with a IE7 display bug.</p>
<p>Back story: we are using jQuery&#8217;s superfish drop down menus (a jQuery based implement of suckerfish/son of suckerfish) for site navigation.  Everything works great in Firefox 2/3 and Safari.  I&#8217;m going to assume that IE6 looks great as well since suckerfish is known to work well in IE6.</p>
<p>IE7 is a different story.</p>
<p>There is a large image directly beneath the navigation menu.  Unfortunately for me, in IE7 the menu was being rendered beneath the image, despite having a z-index of 1001.  </p>
<p>After some careful (and careless) digging and googling, I came across <a href="http://forums.digitalpoint.com/showpost.php?s=342944c431955c86ef8c99dca9bcdc4b&amp;p=6669834&amp;postcount=12">a solution</a>.</p>
<p>To summarize, IE7 will not render the menu with the appropriate z-index unless that z-index is present on the top level :hover style.  To clarify:</p>
<p><code><br />
/*** ESSENTIAL STYLES ***/<br />
.sf-menu, .sf-menu * {<br />
	margin:			0;<br />
	padding:		0;<br />
	list-style:		none;<br />
}<br />
.sf-menu {<br />
	line-height:	1.0;<br />
}<br />
.sf-menu ul {<br />
	position:		absolute;<br />
	top:			-999em;<br />
}<br />
.sf-menu li:hover {<br />
	z-index: 100; /* This is the important style directive, without it IE7 chokes */<br />
}<br />
.sf-menu * li:hover {<br />
	visibility:		inherit; /* fixes IE7 'sticky bug' */<br />
	font-weight:	bold;<br />
}<br />
</code></p>
<p><a href='http://facility9.com/files/2008/07/ie7suckerfishhover.css' title='IE7 Suckerfish Hover CSS'>IE7 Suckerfish Hover CSS</a></p>
]]></content:encoded>
			<wfw:commentRss>http://facility9.com/2008/07/17/ie7-dropdowns-and-z-index/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Who needs valid XML?</title>
		<link>http://facility9.com/2008/07/15/who-needs-valid-xml/</link>
		<comments>http://facility9.com/2008/07/15/who-needs-valid-xml/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 15:32:45 +0000</pubDate>
		<dc:creator>jeremiah</dc:creator>
		
		<category><![CDATA[TFS]]></category>

		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://facility9.com/2008/07/15/who-needs-valid-xml/</guid>
		<description><![CDATA[Team Foundation Server, apparently.  
Let&#8217;s say that some careless developer (me) forgot to close an XML tag.  The aforementioned developer then checked in his build file and attempted to build it.  
At this point, I got a bit worried because TFS came back with the following error:
TF42046: The build service used in [...]]]></description>
			<content:encoded><![CDATA[<p>Team Foundation Server, apparently.  </p>
<p>Let&#8217;s say that some careless developer (me) forgot to close an XML tag.  The aforementioned developer then checked in his build file and attempted to build it.  </p>
<p>At this point, I got a bit worried because TFS came back with the following error:</p>
<p><em>TF42046: The build service used in the build process is not reachable.  This error occurs when either the build machine is off-line,the required service is not running, Team Build is not installed on the build machine, Team Build is configured for a different Team Foundation Server or the network is not available.</em></p>
<p>So, at this point I spent a few minutes attempting to debug this problem.  It turns out that this problem can also be caused by silly developers leaving off closing XML tags in their hurry to finish the weekly build script. </p>
<p>Why would Visual Studio throw back this seemingly unhelpful message?  Probably because my XML was garbage and TFS simply refused to talk to me on the grounds that I am uncouth and trying to shout the XML equivalent of dirty words at it.</p>
<p>Moral of the story: close your XML tags and don&#8217;t hurry.</p>
<p>[edit]<br />
Rick has informed me that I am a horrible developer and forgot to mention his involvement in this whole issue.  So, Rick, thanks for helping me troubleshoot this problem.  Read his blog, it&#8217;s at <a href="http://rickdoes.net/blog/">RickDoes.net</a>.  Did you notice that URL?  He&#8217;s witty, much wittier than I.</p>
]]></content:encoded>
			<wfw:commentRss>http://facility9.com/2008/07/15/who-needs-valid-xml/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SQL Server 2008 Installation Features</title>
		<link>http://facility9.com/2008/07/11/sql-server-2008-installation-features/</link>
		<comments>http://facility9.com/2008/07/11/sql-server-2008-installation-features/#comments</comments>
		<pubDate>Fri, 11 Jul 2008 11:26:00 +0000</pubDate>
		<dc:creator>jeremiah</dc:creator>
		
		<category><![CDATA[SQL Server]]></category>

		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://facility9.com/2008/07/11/sql-server-2008-installation-features/</guid>
		<description><![CDATA[Eric Johnson has put up a fantastic post detailing the new SQL Server 2008 Installation Wizard or, as it is officially named, SQL Server Installation Center.
Rather than summarize, I&#8217;ve just provided a link.  It&#8217;s short, sweet, to the point, and full of screen shots.
]]></description>
			<content:encoded><![CDATA[<p>Eric Johnson has put up a fantastic post detailing <a href="http://sqlblog.com/blogs/eric_johnson/archive/2008/07/10/new-sql-server-2008-install-contains-some-useful-features.aspx">the new SQL Server 2008 Installation Wizard or, as it is officially named, SQL Server Installation Center.</a></p>
<p>Rather than summarize, I&#8217;ve just provided a link.  It&#8217;s short, sweet, to the point, and full of screen shots.</p>
]]></content:encoded>
			<wfw:commentRss>http://facility9.com/2008/07/11/sql-server-2008-installation-features/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Software Development Meme</title>
		<link>http://facility9.com/2008/07/05/software-development-meme/</link>
		<comments>http://facility9.com/2008/07/05/software-development-meme/#comments</comments>
		<pubDate>Sun, 06 Jul 2008 02:49:34 +0000</pubDate>
		<dc:creator>jeremiah</dc:creator>
		
		<category><![CDATA[code]]></category>

		<category><![CDATA[nonsense]]></category>

		<guid isPermaLink="false">http://facility9.com/2008/07/05/software-development-meme/</guid>
		<description><![CDATA[Rick, I&#8217;m stealing your post.  Which is okay because you stole it first.
How old were you when you started programming? 
I originally started learning BASIC when I was very young, probably 11 or so.  I gave up on programming for more worldly pursuits, only to come back to it 10 years later.
How did [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://rickdoes.net">Rick</a>, I&#8217;m stealing your <a href="http://rickdoes.net/blog/archive/2008/06/05/blankenthoughts-software-development-meme.aspx">post</a>.  Which is okay because you stole it first.</p>
<p><strong>How old were you when you started programming? </strong><br />
I originally started learning BASIC when I was very young, probably 11 or so.  I gave up on programming for more worldly pursuits, only to come back to it 10 years later.</p>
<p><strong>How did you get started in programming? </strong><br />
The second time around I wanted to create a &#8216;blog&#8217;, although at the time I don&#8217;t think we called them blogs.  I think we called them e/n sites (everything/nothing).  So I taught myself HTML.</p>
<p><strong>What was your first language?</strong><br />
HTML, CSS, and Perl.  It was a triple whammy.</p>
<p><strong>What was the first real program you wrote? </strong><br />
The first <em>real</em> business program I wrote was a socket server written in PERL that accepted a rudimentary home grown protocol.  It was used to remotely monitor the health of 8 different servers.  What can I say, I started out as an HP-UX sysadmin.</p>
<p><strong>What languages have you used since you started programming? </strong><br />
HTML, CSS, JavaScript, C#, VB.NET, ASP.NET, PERL, Python, Ruby, SQL (T-SQL, PL/SQL, PL/PGSQL), PowerShell, BASH scripts, SVG, XPath, XQuery, XSLT, ActionScript.  Jack of all trades, master of none.</p>
<p><strong>What was your first professional programming gig? </strong><br />
I worked at Qwest Communications writing unimpressive PERL scripts to automate keeping an Actuate Reporting Server running without <em>too</em> many memory leaks.  I graduated to doing the same thing for Local Number Portability software.  If you don&#8217;t know what LNP is, just think of it this way: it&#8217;s the reason your calls go through and the reason you can change carriers and keep the same number.</p>
<p><strong>If you knew then what you know now, would you have started programming? </strong><br />
I might have kept with it when I was younger.  Although, frankly, I think a good part of my approach and expertise come from my lack of formal training and my background in the Humanities.  Getting a four year degree in CS would have probably proved impossible for me.  However, that BA in English has taught me a great deal about the importance of communication, documentation, and solid presentational skills.</p>
<p><strong>If there is one thing you learned along the way that you would tell new developers, what would it be? </strong><br />
Communication is key.  This stretches across every aspect of what we do on a daily basis.  If you can&#8217;t communicate your ideas clearly and succinctly, the boss is never going to push for your pet project.  If you can&#8217;t describe a problem well to non-technical people, they will never understand the importance of the issue.  If you can&#8217;t share your failures and successes with fellow developers, someone will end up repeating your mistakes.  Communicating is how we all learn.  If people didn&#8217;t feel the urge to share their knowledge and write books, we would still be building Altair clones in our basements from Radio Shack kits.</p>
<p><strong>What&#8217;s the most fun you&#8217;ve ever had &#8230; programming? </strong><br />
Frankly, every day is fun.  I get to share knowledge with some exceptionally talented developers and I&#8217;m always learning from them.  The <em>best</em> times are when I get to work with a dynamic team of people and build on each others ideas to make the best software we can.</p>
]]></content:encoded>
			<wfw:commentRss>http://facility9.com/2008/07/05/software-development-meme/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Evaluating IS NULL vs &#60;&#62; with T-SQL DATETIMEs</title>
		<link>http://facility9.com/2008/07/05/evaluating-is-null-vs-with-t-sql-datetimes/</link>
		<comments>http://facility9.com/2008/07/05/evaluating-is-null-vs-with-t-sql-datetimes/#comments</comments>
		<pubDate>Sun, 06 Jul 2008 02:20:55 +0000</pubDate>
		<dc:creator>jeremiah</dc:creator>
		
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://facility9.com/2008/07/05/evaluating-is-null-vs-with-t-sql-datetimes/</guid>
		<description><![CDATA[Many OR/Ms use an UpdatedAt column and some even use a DeletedAt column for soft deletes.  This practice also carries over when using date ranges for controlling notification display (StartDate and EndDate).  
I&#8217;ve often heard many DBAs make the claim that doing a date comparison is faster than checking if the value in [...]]]></description>
			<content:encoded><![CDATA[<p>Many OR/Ms use an UpdatedAt column and some even use a DeletedAt column for soft deletes.  This practice also carries over when using date ranges for controlling notification display (StartDate and EndDate).  </p>
<p>I&#8217;ve often heard many DBAs make the claim that doing a date comparison is faster than checking if the value in a date column IS NULL, so I decided to run some primitive benchmarks to see what I would discover.  Admittedly, I&#8217;ve also held this belief myself, but I&#8217;ve never witnessed any numbers to either prove or disprove the theory.</p>
<p>First, I created two tables with two columns each - CreatedAt and DeletedAt.  One table allows NULLs in the DeletedAt column, the other does not.  </p>
<p>Next I filled each table with 1,000,000 random DATETIME values.  Each table recieved the exact same DATETIME values in each row and a random number seed was used to determine whether or not the NULL table would have a NULL value or a random DeletedAt value.  In my test case, 500843 records had a NULL value.  I then ran three separate queries to compare the performance of IS NULL against .  Before and after each query, the current time was stored in a variable which was manipulated using a millisecond DATEDIFF to determine the total execution time.</p>
<link rel="stylesheet" href="http://facility9.com/wp-content/plugins/codeviewer/codeviewer.css" type="text/css" media="all" />
<ol class="codelist">
<li value="1" class="tab0 odd"><code>-- turn off printing row counts to speed up processing</code></li>
<li value="2" class="tab0 even"><code>SET NOCOUNT ON;</code></li>
<li value="3" class="odd">&nbsp;</li>
<li value="4" class="tab0 even"><code>-- Create test tables</code></li>
<li value="5" class="tab0 odd"><code>IF OBJECT_ID('Benchmarking.dbo.TestNullDatetime', 'U') IS NULL</code></li>
<li value="6" class="tab0 even"><code>BEGIN</code></li>
<li value="7" class="tab1 odd"><code>CREATE TABLE TestNullDatetime</code></li>
<li value="8" class="tab1 even"><code>(</code></li>
<li value="9" class="tab2 odd"><code>CreatedAt DATETIME NOT NULL,</code></li>
<li value="10" class="tab2 even"><code>DeletedAt DATETIME</code></li>
<li value="11" class="tab1 odd"><code>);</code></li>
<li value="12" class="tab0 even"><code>END;</code></li>
<li value="13" class="odd">&nbsp;</li>
<li value="14" class="tab0 even"><code>IF OBJECT_ID('Benchmarking.dbo.TestNotNulLDatetime', 'U') IS NULL</code></li>
<li value="15" class="tab0 odd"><code>BEGIN</code></li>
<li value="16" class="tab1 even"><code>CREATE TABLE TestNotNullDateTime</code></li>
<li value="17" class="tab1 odd"><code>(</code></li>
<li value="18" class="tab2 even"><code>CreatedAt DATETIME NOT NULL,</code></li>
<li value="19" class="tab2 odd"><code>DeletedAt DATETIME NOT NULL</code></li>
<li value="20" class="tab1 even"><code>);</code></li>
<li value="21" class="tab0 odd"><code>END;</code></li>
<li value="22" class="even">&nbsp;</li>
<li value="23" class="tab0 odd"><code>DECLARE @counter	INT;</code></li>
<li value="24" class="tab0 even"><code>DECLARE @random		FLOAT;</code></li>
<li value="25" class="tab0 odd"><code>DECLARE @threshold	FLOAT;</code></li>
<li value="26" class="tab0 even"><code>DECLARE @current    DATETIME;</code></li>
<li value="27" class="tab0 odd"><code>DECLARE @deleted    DATETIME;</code></li>
<li value="28" class="even">&nbsp;</li>
<li value="29" class="tab0 odd"><code>SET @threshold = 0.5;</code></li>
<li value="30" class="tab0 even"><code>SET @counter   = 0;</code></li>
<li value="31" class="odd">&nbsp;</li>
<li value="32" class="tab0 even"><code>WHILE @counter &lt; 1000000</code></li>
<li value="33" class="tab0 odd"><code>BEGIN</code></li>
<li value="34" class="tab1 even"><code>SET @random = RAND();</code></li>
<li value="35" class="tab1 odd"><code>SET @current = GETDATE();</code></li>
<li value="36" class="tab1 even"><code>SET @deleted = @current + (@random * 9.5);</code></li>
<li value="37" class="odd">&nbsp;</li>
<li value="38" class="even">&nbsp;</li>
<li value="39" class="tab1 odd"><code>IF @random &gt; @threshold</code></li>
<li value="40" class="tab1 even"><code>BEGIN</code></li>
<li value="41" class="tab2 odd"><code>INSERT INTO TestNullDatetime VALUES (@current, NULL);</code></li>
<li value="42" class="tab2 even"><code>INSERT INTO TestNotNullDatetime VALUES (@current, @current);</code></li>
<li value="43" class="tab1 odd"><code>END</code></li>
<li value="44" class="tab1 even"><code>ELSE</code></li>
<li value="45" class="tab1 odd"><code>BEGIN</code></li>
<li value="46" class="tab2 even"><code>INSERT INTO TestNullDatetime VALUES (@current, @deleted);</code></li>
<li value="47" class="tab2 odd"><code>INSERT INTO TestNotNullDatetime VALUES (@current, @deleted);</code></li>
<li value="48" class="tab1 even"><code>END</code></li>
<li value="49" class="odd">&nbsp;</li>
<li value="50" class="tab1 even"><code>SET @counter = @counter + 1;</code></li>
<li value="51" class="tab0 odd"><code>END</code></li>
<li value="52" class="even">&nbsp;</li>
<li value="53" class="odd">&nbsp;</li>
<li value="54" class="even">&nbsp;</li>
<li value="55" class="tab0 odd"><code>DECLARE @start DATETIME;</code></li>
<li value="56" class="tab0 even"><code>DECLARE @end DATETIME</code></li>
<li value="57" class="odd">&nbsp;</li>
<li value="58" class="tab0 even"><code>DECLARE @null_isnullcompare INTEGER;</code></li>
<li value="59" class="tab0 odd"><code>DECLARE @null_notequalcompare INTEGER;</code></li>
<li value="60" class="tab0 even"><code>DECLARE @notnull_notequalcompare INTEGER;</code></li>
<li value="61" class="odd">&nbsp;</li>
<li value="62" class="tab0 even"><code>SET @start = GETDATE();</code></li>
<li value="63" class="tab0 odd"><code>SELECT * FROM TestNullDatetime WHERE DeletedAt IS NOT NULL;</code></li>
<li value="64" class="tab0 even"><code>SET @end = GETDATE();</code></li>
<li value="65" class="odd">&nbsp;</li>
<li value="66" class="tab0 even"><code>SET @null_isnullcompare = DATEDIFF(ms, @start, @end);</code></li>
<li value="67" class="odd">&nbsp;</li>
<li value="68" class="tab0 even"><code>SET @start = GETDATE();</code></li>
<li value="69" class="tab0 odd"><code>SELECT * FROM TestNullDatetime WHERE DeletedAt &lt;&gt; CreatedAt;</code></li>
<li value="70" class="tab0 even"><code>SET @end = GETDATE();</code></li>
<li value="71" class="odd">&nbsp;</li>
<li value="72" class="tab0 even"><code>SET @null_notequalcompare = DATEDIFF(ms, @start, @end);</code></li>
<li value="73" class="odd">&nbsp;</li>
<li value="74" class="tab0 even"><code>SET @start = GETDATE();</code></li>
<li value="75" class="tab0 odd"><code>SELECT * FROM TestNotNullDatetime WHERE DeletedAt &lt;&gt; CreatedAt;</code></li>
<li value="76" class="tab0 even"><code>SET @end = GETDATE();</code></li>
<li value="77" class="odd">&nbsp;</li>
<li value="78" class="tab0 even"><code>SET @notnull_notequalcompare = DATEDIFF(ms, @start, @end);</code></li>
<li value="79" class="odd">&nbsp;</li>
<li value="80" class="tab0 even"><code>SELECT @null_isnullcompare AS [NULL - IS NULL comparison],</code></li>
<li value="81" class="tab1 odd"><code>@null_notequalcompare AS [NULL - NOT EQUAL comparison],</code></li>
<li value="82" class="tab1 even"><code>@notnull_notequalcompare AS [NOT NULL - NOT EQUAL comparison];</code></li>
<li value="83" class="odd">&nbsp;</li>
<li value="84" class="even">&nbsp;</li>
<li value="85" class="tab0 odd"><code>-- restore original state</code></li>
<li value="86" class="tab0 even"><code>SET NOCOUNT OFF;</code></li>
<li class="sourcelink"><strong>Download this code:</strong> <a href="http://facility9.com/files/2008/07/benchmarking.sql">benchmarking.sql</a></li>
</ol>
<p>The results are as follows:</p>
<table border='1'>
<tr>
<th>Run</th>
<th>NULL table, IS NULL</th>
<th>NULL table, &lt;&gt;</th>
<th>NOT NULL table, &lt;&gt;</th>
</tr>
<tr>
<td>1</td>
<td>5470</td>
<td>5436</td>
<td>5373</td>
</tr>
<tr>
<td>2</td>
<td>5563</td>
<td>5516</td>
<td>5546</td>
</tr>
<tr>
<td>3</td>
<td>5936</td>
<td>5750</td>
<td>5466</td>
</tr>
<tr>
<td>4</td>
<td>5500</td>
<td>5453</td>
<td>5390</td>
</tr>
<tr>
<td>5</td>
<td>5576</td>
<td>5640</td>
<td>5440</td>
</tr>
<tr>
<td>AVG</td>
<td>5609</td>
<td>5559</td>
<td>5443</td>
</tr>
</table>
<p>Overall, the &lt;&gt; comparison is faster than an IS NULL comparison, and it is approximately 100 milliseconds faster to perform on a table with no NULLs than on a table with roughly 50% NULL values.</p>
<p>Of course, it&#8217;s important to take note these are all hot cache hits.  I didn&#8217;t take the time to reboot my machine and determine the difference running this against a cold cache, however I suspect that the results would still be the same.</p>
<p>Testing was performed on a 2.0 GHz Core 2 Duo laptop running Windows XP SP2, SQL Server 2005 Developer Edition (patch level 9.0.3054), with 2 GB of RAM and 7200 RPM drives.  It&#8217;s an HP Pavilion dv9000t, for those who are interested.</p>
]]></content:encoded>
			<wfw:commentRss>http://facility9.com/2008/07/05/evaluating-is-null-vs-with-t-sql-datetimes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>In Re: A default architecture – without stored Procedures</title>
		<link>http://facility9.com/2008/07/03/in-re-a-default-architecture-%e2%80%93-without-stored-procedures/</link>
		<comments>http://facility9.com/2008/07/03/in-re-a-default-architecture-%e2%80%93-without-stored-procedures/#comments</comments>
		<pubDate>Thu, 03 Jul 2008 19:42:23 +0000</pubDate>
		<dc:creator>jeremiah</dc:creator>
		
		<category><![CDATA[sql]]></category>

		<category><![CDATA[data access]]></category>

		<guid isPermaLink="false">http://facility9.com/2008/07/03/in-re-a-default-architecture-%e2%80%93-without-stored-procedures/</guid>
		<description><![CDATA[I wrote this today in response to Patrik Löwendahl&#8217;s post: A default architecture – without stored Procedures .  I figured that I might as well post it up here, too, so that people can comment on my rantings.
You&#8217;d be hard pressed to get me to concede that a data access scheme based on stored [...]]]></description>
			<content:encoded><![CDATA[<p><em>I wrote this today in response to Patrik Löwendahl&#8217;s post: <a href="http://www.lowendahl.net/showShout.aspx?id=213">A default architecture – without stored Procedures </a>.  I figured that I might as well post it up here, too, so that people can comment on my rantings.</em></p>
<p><em>You&#8217;d be hard pressed to get me to concede that a data access scheme based on stored procedures is a bad idea.  In the absence of that, buy <a href="http://llblgen.com">a good ORM tool</a>.  </em></p>
<p>I&#8217;m going to take a stab and responding to each of your points because I think it&#8217;s good to get a dialog going on these kinds of things.</p>
<p><strong>Pain Point the First: Version Management</strong><br />
I&#8217;m not sure what you mean by this.  It&#8217;s fairly trivial to version control SQL files, however I&#8217;m guessing that you aren&#8217;t having any difficulty with adding plain text files to version control.  So, I&#8217;m going to make a guess and say that this has something to do with quickly determining which version of development code is in the database.  This can be somewhat tricky.  It becomes necessary to use some kind of build/migration system similar to the one used in Ruby on Rails where you have a schema_info table with a version column that is incremented or decremented by an automated tool.  At this point, a high level of DBA discipline is required to prevent changes from being made in production that are not present in source control and vice versa.</p>
<p><strong>Pain Point the Second: Two Code Bases</strong><br />
Again, I&#8217;m not sure what is meant by this.  You&#8217;re absolutely right, maintaining stored procedures does require two skill sets.  In an ideal world there would be a distinct separation of skills between database and application developers.  While basic to intermediate SQL can be handled by most developers, venturing into high performance/advanced SQL requires a distinct skill set that requires years of experience and conscious practice.</p>
<p><strong>Pain Point the Third: Business Logic</strong><br />
I&#8217;ve said this a large number of times over my career as both an application developer and database developer: business logic does not belong in the database.  By default T-SQL will compile and store the first execution path it encounters in a stored proc.  Let&#8217;s say you have a procedure with two branches, one performs a simple insert and the other performs a complex operation that can benefit from a compiled execution plan.  If the simple insert statement branch is the first branch to be executed, it will be compiled and the other, complex, path with be performed as an ad hoc query unless the stored proc is ALTERed and the second execution path is executed.  If you need complex logic and you have SQL 2005, you can use CLR stored procedures.</p>
<p><strong>Pain Point the Fourth: Testing Stored Procedures</strong><br />
While I&#8217;m definitely not an expert on the subject of testing stored procedures, I have read numerous resources on the subject of testing stored procedures.  Adam Machanic devotes some time to it in Expert SQL Server Programming.  I&#8217;ll leave this topic to the experts.</p>
<p><strong>Pain Point the Fifth: Writing Trivial SQL</strong><br />
When you&#8217;re operating, or attempting to operate, a high performance, high access database, there are no trivial data access calls.  Granted, for the majority of data access scenarios (SELECT a, b, c FROM xyz WHERE param = @param), a stored procedure could be described as development overhead.  This is a point that we agree on.  However, I see the point that many DBAs have - if they want to change the underlying schema for performance/storage considerations, they should be able to do so as long as they provide developers with the same set of outputs as before, given the same inputs of course.</p>
<p><strong>Pain Point the Sixth: Stored Procedures aren&#8217;t Dynamic</strong><br />
Nor should they ever be.  The point of a stored procedure is to access data as efficiently as possible.  In the event that you have multiple potential join combinations, you will need multiple stored procedures.  Not to sound insulting, but the demand for multiple potential join combinations sounds like, to me, a poorly planned data access scenario.  There are ways to dynamically generate WHERE and ORDER BY clauses using T-SQL and parameterized procedures/queries.  </p>
<p>Ultimately, of course, the purpose of a stored procedure is to increase performance, granularity of data access, and provide an additional layer of security on top of the data.  A data access solution based around stored procedures isn&#8217;t for every one, but it&#8217;s always good to know the reasons why you should be using it.</p>
]]></content:encoded>
			<wfw:commentRss>http://facility9.com/2008/07/03/in-re-a-default-architecture-%e2%80%93-without-stored-procedures/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dark Visual Studio</title>
		<link>http://facility9.com/2008/07/03/dark-visual-studio/</link>
		<comments>http://facility9.com/2008/07/03/dark-visual-studio/#comments</comments>
		<pubDate>Thu, 03 Jul 2008 11:33:51 +0000</pubDate>
		<dc:creator>jeremiah</dc:creator>
		
		<category><![CDATA[Visual Studio]]></category>

		<category><![CDATA[vs2008]]></category>

		<guid isPermaLink="false">http://facility9.com/2008/07/03/dark-visual-studio/</guid>
		<description><![CDATA[In my attempts to customize Visual Studio 2008, after 6 months of Rails development in e, I came across a couple of links.
John Lam on Vibrant Ink
and
Dark Visual Studio
almost forgot
Scott Hanselman&#8217;s slightly more manual instructions
Now, either one of these will attempt to set your layout to the author&#8217;s favorite settings which, frankly, are not my [...]]]></description>
			<content:encoded><![CDATA[<p>In my attempts to customize Visual Studio 2008, after 6 months of Rails development in e, I came across a couple of links.</p>
<p><a href="http://www.iunknown.com/2007/06/vibrant_ink_vis.html">John Lam on Vibrant Ink</a><br />
and<br />
<a href="http://weblogs.asp.net/meligy/archive/2008/05/22/dark-visual-studio-with-resharper-my-vs-settings-colors-windows-layout-v2.aspx">Dark Visual Studio</a><br />
almost forgot<br />
<a href="http://www.hanselman.com/blog/ChangingYourColorsInVisualStudioNETBlackVersusWhite.aspx">Scott Hanselman&#8217;s slightly more manual instructions</a></p>
<p>Now, either one of these will attempt to set your layout to the author&#8217;s favorite settings which, frankly, are not my favorite settings.  Make sure to uncheck at least the following items, if you want your Visual Studio layout to stay the same:</p>
<ul>
<li>Work Item Tracking - View Settings</li>
<li>Visual Studio Team Foundation Server</li>
<li>General Settings -&gt; Window Layouts</li>
<li>General Settings -&gt; Toolbox</li>
<li>General Settings -&gt; Menu and Command Bar Customizations</li>
</ul>
<p>Any other suggestions for keeping as much of your preferred layout around are greatly appreciated.</p>
]]></content:encoded>
			<wfw:commentRss>http://facility9.com/2008/07/03/dark-visual-studio/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dear PostgreSQL</title>
		<link>http://facility9.com/2008/02/20/dear-postgresql/</link>
		<comments>http://facility9.com/2008/02/20/dear-postgresql/#comments</comments>
		<pubDate>Wed, 20 Feb 2008 13:22:25 +0000</pubDate>
		<dc:creator>jeremiah</dc:creator>
		
		<category><![CDATA[nonsense]]></category>

		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://facility9.com/2008/02/20/dear-postgresql/</guid>
		<description><![CDATA[Dear PostgreSQL,
Your documentation is awesome.  You are awesome.  
Thanks,
me
But, seriously, PostgreSQL has the best documentation of any FOSS database I&#8217;ve used (I&#8217;m looking at you MySQL).  Combined with its ability to handle just about anything I throw at it in a timely manner, PostgreSQL is impressing me more and more.  I [...]]]></description>
			<content:encoded><![CDATA[<p><em>Dear PostgreSQL,</p>
<p>Your documentation is awesome.  You are awesome.  </p>
<p>Thanks,</p>
<p>me</em></p>
<p>But, seriously, PostgreSQL has the best documentation of any FOSS database I&#8217;ve used (I&#8217;m looking at you MySQL).  Combined with its ability to handle just about anything I throw at it in a timely manner, PostgreSQL is impressing me more and more.  I just need to figure out how to get plpgsql working in my normal queries instead of in functions&#8230; or else I need to give up and start writing all of my ETL scripts as functions (which seems somewhat expensive).</p>
]]></content:encoded>
			<wfw:commentRss>http://facility9.com/2008/02/20/dear-postgresql/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Behold, the power of science!</title>
		<link>http://facility9.com/2008/01/29/behold-the-power-of-science/</link>
		<comments>http://facility9.com/2008/01/29/behold-the-power-of-science/#comments</comments>
		<pubDate>Tue, 29 Jan 2008 13:26:07 +0000</pubDate>
		<dc:creator>jeremiah</dc:creator>
		
		<category><![CDATA[nonsense]]></category>

		<category><![CDATA[awesome]]></category>

		<category><![CDATA[LISP]]></category>

		<category><![CDATA[MIT]]></category>

		<guid isPermaLink="false">http://facility9.com/2008/01/29/behold-the-power-of-science/</guid>
		<description><![CDATA[Once upon a time, back in the 60s, some MIT nerds took it upon themselves to &#8220;waste&#8221; valuable research computer time to compute the ideal route to ride the entire New York subway system.  This is a pretty interesting look at how to coordinate a project to achieve a monumental feat purely for the [...]]]></description>
			<content:encoded><![CDATA[<p>Once upon a time, back in the 60s, some MIT nerds took it upon themselves to &#8220;waste&#8221; valuable research computer time to compute the ideal route to ride the entire New York subway system.  This is a pretty interesting look at how to coordinate a project to achieve a monumental feat purely for the point of achieving it.  Sort of like Alex Roy&#8217;s 31 hour drive across the US.</p>
<p>Anyways, <a href="http://www.gricer.com/anysrc/anysrc.html">The Rise and Fall of the Amateur New York Subway Riding Committee</a>.</p>
<p>I found this think through anarchaia, so I can&#8217;t take any credit for finding it.  But I can take credit for pronouncing it to be awesome</p>
]]></content:encoded>
			<wfw:commentRss>http://facility9.com/2008/01/29/behold-the-power-of-science/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
