<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Catch-all queries</title>
	<atom:link href="http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/feed/" rel="self" type="application/rss+xml" />
	<link>http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/</link>
	<description>A discussion on SQL Server</description>
	<lastBuildDate>Mon, 30 Jan 2012 12:44:25 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Gail</title>
		<link>http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/comment-page-2/#comment-1958</link>
		<dc:creator>Gail</dc:creator>
		<pubDate>Wed, 25 Jan 2012 18:06:30 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=174#comment-1958</guid>
		<description>Same (I tested it on a forum post, not here). 

It has the same performance effects as the WHERE (@ProductID IS NULL OR ProductID = @ProductID), however I don&#039;t know if OPTION(RECOMPILE) will help that form, depends whether the optimiser can recognise the construct or not (also make sure you&#039;re on 2008 SP2 or above before trying RECOMPILE)</description>
		<content:encoded><![CDATA[<p>Same (I tested it on a forum post, not here). </p>
<p>It has the same performance effects as the WHERE (@ProductID IS NULL OR ProductID = @ProductID), however I don&#8217;t know if OPTION(RECOMPILE) will help that form, depends whether the optimiser can recognise the construct or not (also make sure you&#8217;re on 2008 SP2 or above before trying RECOMPILE)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bikerdad</title>
		<link>http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/comment-page-2/#comment-1957</link>
		<dc:creator>Bikerdad</dc:creator>
		<pubDate>Wed, 25 Jan 2012 16:57:06 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=174#comment-1957</guid>
		<description>G&#039;morning Gail,

I just got referred in to this post from somewhere or other, and since I use a variety of NULL conditions, I was wondering how my preferred structure works, since I don&#039;t see it above.

I often use this structure:

WHERE (CASE WHEN @ProductID IS NULL THEN 1
            WHEN @ProductID = ProductID THEN 1
            ELSE 0
       END) = 1

More efficient, same, less efficient, or truly horrible?

When using multi-value parameters, I try to always bust the passed in string down to a table (variable or temp, depending on my mood), then join to the result.

One definite takeaway for me will be to use the OPTION(RECOMPILE) in any of my procs where I&#039;m allowing a NULL parameter.</description>
		<content:encoded><![CDATA[<p>G&#8217;morning Gail,</p>
<p>I just got referred in to this post from somewhere or other, and since I use a variety of NULL conditions, I was wondering how my preferred structure works, since I don&#8217;t see it above.</p>
<p>I often use this structure:</p>
<p>WHERE (CASE WHEN @ProductID IS NULL THEN 1<br />
            WHEN @ProductID = ProductID THEN 1<br />
            ELSE 0<br />
       END) = 1</p>
<p>More efficient, same, less efficient, or truly horrible?</p>
<p>When using multi-value parameters, I try to always bust the passed in string down to a table (variable or temp, depending on my mood), then join to the result.</p>
<p>One definite takeaway for me will be to use the OPTION(RECOMPILE) in any of my procs where I&#8217;m allowing a NULL parameter.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gail</title>
		<link>http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/comment-page-1/#comment-1952</link>
		<dc:creator>Gail</dc:creator>
		<pubDate>Thu, 19 Jan 2012 09:33:05 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=174#comment-1952</guid>
		<description>The dynamic SQL route works fine in SQL 2005. In fact, on 2005 it&#039;s the best option because you can&#039;t use the OPTION(RECOMPILE)</description>
		<content:encoded><![CDATA[<p>The dynamic SQL route works fine in SQL 2005. In fact, on 2005 it&#8217;s the best option because you can&#8217;t use the OPTION(RECOMPILE)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: RickD</title>
		<link>http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/comment-page-1/#comment-1951</link>
		<dc:creator>RickD</dc:creator>
		<pubDate>Thu, 19 Jan 2012 09:29:48 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=174#comment-1951</guid>
		<description>Hi Gail, Niice article, I wish I could follow the dynamic SQL route but am still struggling alomng with SQL 2005. I got around the inefficiency by intoducing pagination to my query. I get 10 (or 20,30 etc) records key fields with all the parameters (the query itself is very convoluted, so not going to even attempt to post it), then get the detail I need in a following query. This and other changes (many of my parameters are multi-select, so used a CLR to split into mem tables), took a query that was taking well over a second (usually about 1600ms) down to &lt;100ms even for the worst culprits.</description>
		<content:encoded><![CDATA[<p>Hi Gail, Niice article, I wish I could follow the dynamic SQL route but am still struggling alomng with SQL 2005. I got around the inefficiency by intoducing pagination to my query. I get 10 (or 20,30 etc) records key fields with all the parameters (the query itself is very convoluted, so not going to even attempt to post it), then get the detail I need in a following query. This and other changes (many of my parameters are multi-select, so used a CLR to split into mem tables), took a query that was taking well over a second (usually about 1600ms) down to &lt;100ms even for the worst culprits.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gail</title>
		<link>http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/comment-page-1/#comment-1912</link>
		<dc:creator>Gail</dc:creator>
		<pubDate>Thu, 24 Nov 2011 10:18:59 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=174#comment-1912</guid>
		<description>Nice. I&#039;d leave a comment there, but I don&#039;t see any way to do so.</description>
		<content:encoded><![CDATA[<p>Nice. I&#8217;d leave a comment there, but I don&#8217;t see any way to do so.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Jackson</title>
		<link>http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/comment-page-1/#comment-1910</link>
		<dc:creator>Dave Jackson</dc:creator>
		<pubDate>Wed, 23 Nov 2011 10:40:56 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=174#comment-1910</guid>
		<description>Gail

just to let you now I&#039;ve referenced this page from something I&#039;ve posted to my site. http://glossopian.co.uk/pmwiki.php?n=Main.TestScriptGenerator 
I hope you enjoy it.</description>
		<content:encoded><![CDATA[<p>Gail</p>
<p>just to let you now I&#8217;ve referenced this page from something I&#8217;ve posted to my site. <a href="http://glossopian.co.uk/pmwiki.php?n=Main.TestScriptGenerator" rel="nofollow">http://glossopian.co.uk/pmwiki.php?n=Main.TestScriptGenerator</a><br />
I hope you enjoy it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gail</title>
		<link>http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/comment-page-1/#comment-1848</link>
		<dc:creator>Gail</dc:creator>
		<pubDate>Thu, 22 Sep 2011 11:48:08 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=174#comment-1848</guid>
		<description>Lin, best if you post this on a SQL forum, like the ones at MSDN or SQLServerCentral. Your question has nothing to do with the post.</description>
		<content:encoded><![CDATA[<p>Lin, best if you post this on a SQL forum, like the ones at MSDN or SQLServerCentral. Your question has nothing to do with the post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lin Brown</title>
		<link>http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/comment-page-1/#comment-1847</link>
		<dc:creator>Lin Brown</dc:creator>
		<pubDate>Thu, 22 Sep 2011 09:48:50 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=174#comment-1847</guid>
		<description>Hi, i&#039;m new to sql and i have this problem with updating data from another table.

i want to update table2.message based on the criteria of table1.name. for example, all records named John will be updated with &#039;Msg1&#039; in table 2.message. Im using MS SQL 2000 and below is the scenario. 

&lt;editor: removed&gt;

do you have suggestion on how to update this in bulk without preselecting all the names?</description>
		<content:encoded><![CDATA[<p>Hi, i&#8217;m new to sql and i have this problem with updating data from another table.</p>
<p>i want to update table2.message based on the criteria of table1.name. for example, all records named John will be updated with &#8216;Msg1&#8242; in table 2.message. Im using MS SQL 2000 and below is the scenario. </p>
<p>&lt;editor: removed&gt;</p>
<p>do you have suggestion on how to update this in bulk without preselecting all the names?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gail</title>
		<link>http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/comment-page-1/#comment-1801</link>
		<dc:creator>Gail</dc:creator>
		<pubDate>Thu, 25 Aug 2011 15:35:32 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=174#comment-1801</guid>
		<description>Please post this somewhere like the MSDN forums. There&#039;s no where near enough information given, and your question has nothing to do with this post.</description>
		<content:encoded><![CDATA[<p>Please post this somewhere like the MSDN forums. There&#8217;s no where near enough information given, and your question has nothing to do with this post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dipesh Trivedi</title>
		<link>http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/comment-page-1/#comment-1800</link>
		<dc:creator>Dipesh Trivedi</dc:creator>
		<pubDate>Thu, 25 Aug 2011 15:15:41 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=174#comment-1800</guid>
		<description>Hi
i want to find the combination of Amounts...
For Example : i am inputing amount in textbox vb.net, and result should be all the combination of that entered amount in DB.
textbox.text = 500 then result = lets say
1. 500
2. 250, 250 (in 2 rows)
3. 100,100,100,100,100 (in 5 rows)

is this possible?
Someone can help me on this Please..
My E-mail Id is &lt;removed&gt;

Regards,
Dipesh</description>
		<content:encoded><![CDATA[<p>Hi<br />
i want to find the combination of Amounts&#8230;<br />
For Example : i am inputing amount in textbox vb.net, and result should be all the combination of that entered amount in DB.<br />
textbox.text = 500 then result = lets say<br />
1. 500<br />
2. 250, 250 (in 2 rows)<br />
3. 100,100,100,100,100 (in 5 rows)</p>
<p>is this possible?<br />
Someone can help me on this Please..<br />
My E-mail Id is &lt;removed&gt;</p>
<p>Regards,<br />
Dipesh</p>
]]></content:encoded>
	</item>
</channel>
</rss>

