<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>When you add an index and your query blows up...</title><link>http://sqlblog.com/blogs/alexander_kuznetsov/archive/2009/07/16/when-you-add-an-index-and-your-query-blows-up.aspx</link><description>You cannot assume that the conditions in your WHERE clause will evaluate in the left-to-write order - making such assumptions leads to unsafe queries. For example, the following query is not safe: SELECT * FROM dbo.Messages WHERE ISDATE ( VarcharColumn</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>re: When you add an index and your query blows up...</title><link>http://sqlblog.com/blogs/alexander_kuznetsov/archive/2009/07/16/when-you-add-an-index-and-your-query-blows-up.aspx#15459</link><pubDate>Fri, 24 Jul 2009 07:26:52 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:15459</guid><dc:creator>Marius</dc:creator><description>&lt;p&gt;Hi Alexander,&lt;/p&gt;
&lt;p&gt;I got the same results as your.&lt;/p&gt;
&lt;p&gt;I am running:&lt;/p&gt;
&lt;p&gt;Microsoft SQL Server 2008 (RTM) - 10.0.1600.22 (Intel X86) &amp;nbsp; Jul &amp;nbsp;9 2008 14:43:34 &amp;nbsp; Copyright (c) 1988-2008 Microsoft Corporation &amp;nbsp;Express Edition with Advanced Services on Windows NT 5.1 &amp;lt;X86&amp;gt; (Build 2600: Service Pack 3) &lt;/p&gt;
</description></item><item><title>Without ORDER BY, there is no default sort order.</title><link>http://sqlblog.com/blogs/alexander_kuznetsov/archive/2009/07/16/when-you-add-an-index-and-your-query-blows-up.aspx#17485</link><pubDate>Fri, 09 Oct 2009 21:23:49 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:17485</guid><dc:creator>Alexander Kuznetsov</dc:creator><description>&lt;p&gt;Sounds trivial? Right, but different flavors of this myth still persist. Yesterday I noticed a thread&lt;/p&gt;
</description></item><item><title>re: When you add an index and your query blows up...</title><link>http://sqlblog.com/blogs/alexander_kuznetsov/archive/2009/07/16/when-you-add-an-index-and-your-query-blows-up.aspx#18097</link><pubDate>Wed, 21 Oct 2009 18:53:47 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:18097</guid><dc:creator>Dan</dc:creator><description>&lt;p&gt;Thanks so much for the CASE trick to force data validation before sending the data to the CAST/CONVERT function. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;I found many places online that explained the issue at hand was that there was no guaranteed order to the WHERE execution, but you were the only one to provide a beautiful/simple/elegant solution.&lt;/p&gt;
</description></item></channel></rss>