<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: SQL Server 2000 date and time puzzler</title>
	<atom:link href="http://www.xaprb.com/blog/2005/12/04/sql-server-2000-date-and-time-puzzler/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xaprb.com/blog/2005/12/04/sql-server-2000-date-and-time-puzzler/</link>
	<description>Stay curious!</description>
	<pubDate>Tue, 06 Jan 2009 05:35:58 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Xaprb</title>
		<link>http://www.xaprb.com/blog/2005/12/04/sql-server-2000-date-and-time-puzzler/#comment-3936</link>
		<dc:creator>Xaprb</dc:creator>
		<pubDate>Tue, 06 Feb 2007 22:26:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=51#comment-3936</guid>
		<description>&lt;p&gt;It'll actually depend on the system, and especially if it's in a stored procedure, the values passed for the first invocation will determine the query plan, which will then get stored and used for future calls -- even if they should be optimized differently.  You can defeat that though if you need to.&lt;/p&gt;

&lt;p&gt;If the query plan is re-compiled every time, (@param is null or col = @param) is a better idea.&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>It&#8217;ll actually depend on the system, and especially if it&#8217;s in a stored procedure, the values passed for the first invocation will determine the query plan, which will then get stored and used for future calls &#8212; even if they should be optimized differently.  You can defeat that though if you need to.</p>
<p>If the query plan is re-compiled every time, (@param is null or col = @param) is a better idea.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.xaprb.com/blog/2005/12/04/sql-server-2000-date-and-time-puzzler/#comment-3934</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Tue, 06 Feb 2007 19:25:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=51#comment-3934</guid>
		<description>&lt;p&gt;I'm wondering about the table-scan-ness of ISNULL alternatives. I understand that passing in @parameter and doing:

ISNULL(@parameter, columnName) will cause the table scan.

Your alternative is looking for nulls in the columns. What about if the null is in the paremter?

Will:

... where (@parameter is null or column = @parameter 

perform better?

Thanks!&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>I&#8217;m wondering about the table-scan-ness of ISNULL alternatives. I understand that passing in @parameter and doing:</p>
<p>ISNULL(@parameter, columnName) will cause the table scan.</p>
<p>Your alternative is looking for nulls in the columns. What about if the null is in the paremter?</p>
<p>Will:</p>
<p>&#8230; where (@parameter is null or column = @parameter </p>
<p>perform better?</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
