<?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: Dynamic ordering with T-SQL	</title>
	<atom:link href="https://lobsterpot.com.au/blog/2008/05/12/dynamic-ordering-with-t-sql/feed/" rel="self" type="application/rss+xml" />
	<link>https://lobsterpot.com.au/blog/2008/05/12/dynamic-ordering-with-t-sql/</link>
	<description></description>
	<lastBuildDate>Mon, 29 Dec 2008 11:27:48 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>
		By: Tony		</title>
		<link>https://lobsterpot.com.au/blog/2008/05/12/dynamic-ordering-with-t-sql/#comment-600</link>

		<dc:creator><![CDATA[Tony]]></dc:creator>
		<pubDate>Mon, 29 Dec 2008 11:27:48 +0000</pubDate>
		<guid isPermaLink="false">/blogs/robfarley/archive/2008/05/12/dynamic-ordering-with-t-sql.aspx#comment-600</guid>

					<description><![CDATA[Thanks for this! Saved me a lot of time and headaches!]]></description>
			<content:encoded><![CDATA[<p>Thanks for this! Saved me a lot of time and headaches!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Rob Farley		</title>
		<link>https://lobsterpot.com.au/blog/2008/05/12/dynamic-ordering-with-t-sql/#comment-599</link>

		<dc:creator><![CDATA[Rob Farley]]></dc:creator>
		<pubDate>Wed, 21 May 2008 17:36:11 +0000</pubDate>
		<guid isPermaLink="false">/blogs/robfarley/archive/2008/05/12/dynamic-ordering-with-t-sql.aspx#comment-599</guid>

					<description><![CDATA[Yes Reji, I should&#039;ve mentioned that if you want Descending, you need to put that outside the CASE statement, and if you want to pass that in as an option, then you&#039;ll need an extra CASE for each one.]]></description>
			<content:encoded><![CDATA[<p>Yes Reji, I should&#8217;ve mentioned that if you want Descending, you need to put that outside the CASE statement, and if you want to pass that in as an option, then you&#8217;ll need an extra CASE for each one.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: REJI P R		</title>
		<link>https://lobsterpot.com.au/blog/2008/05/12/dynamic-ordering-with-t-sql/#comment-598</link>

		<dc:creator><![CDATA[REJI P R]]></dc:creator>
		<pubDate>Wed, 21 May 2008 09:14:34 +0000</pubDate>
		<guid isPermaLink="false">/blogs/robfarley/archive/2008/05/12/dynamic-ordering-with-t-sql.aspx#comment-598</guid>

					<description><![CDATA[This query cause a problem when we want to sort in DESC Order ....For that purpose Query must be like 
SELECT custid, custname
FROM Customers
ORDER BY
 CASE WHEN  @SortColumn = &#039;custname&#039; THEN   custname END DESC 

CASE WHEN  @SortColumn = &#039;custid&#039; THEN custid END DESC

]]></description>
			<content:encoded><![CDATA[<p>This query cause a problem when we want to sort in DESC Order &#8230;.For that purpose Query must be like<br />
SELECT custid, custname<br />
FROM Customers<br />
ORDER BY<br />
 CASE WHEN  @SortColumn = &#8216;custname&#8217; THEN   custname END DESC </p>
<p>CASE WHEN  @SortColumn = &#8216;custid&#8217; THEN custid END DESC</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Rob Farley		</title>
		<link>https://lobsterpot.com.au/blog/2008/05/12/dynamic-ordering-with-t-sql/#comment-597</link>

		<dc:creator><![CDATA[Rob Farley]]></dc:creator>
		<pubDate>Mon, 19 May 2008 17:27:35 +0000</pubDate>
		<guid isPermaLink="false">/blogs/robfarley/archive/2008/05/12/dynamic-ordering-with-t-sql.aspx#comment-597</guid>

					<description><![CDATA[Daniel - can you explain what you mean here? If neither condition is satisfied and you sort by NULL, NULL, then that&#039;s perfectly legal. It just won&#039;t produce the data in a known order (it&#039;ll use whichever order it access the data).]]></description>
			<content:encoded><![CDATA[<p>Daniel &#8211; can you explain what you mean here? If neither condition is satisfied and you sort by NULL, NULL, then that&#8217;s perfectly legal. It just won&#8217;t produce the data in a known order (it&#8217;ll use whichever order it access the data).</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Daniel Godoy		</title>
		<link>https://lobsterpot.com.au/blog/2008/05/12/dynamic-ordering-with-t-sql/#comment-596</link>

		<dc:creator><![CDATA[Daniel Godoy]]></dc:creator>
		<pubDate>Mon, 19 May 2008 13:00:34 +0000</pubDate>
		<guid isPermaLink="false">/blogs/robfarley/archive/2008/05/12/dynamic-ordering-with-t-sql.aspx#comment-596</guid>

					<description><![CDATA[Isnt there a risk of generating system comands with the leveraging of null values...  What if 2 nulls occur in a row...  Can that be inturpreted as an end of test by the system?  not too sure what happens under the hood of SQL2k5 but from a programming perspective...   just a thought...
]]></description>
			<content:encoded><![CDATA[<p>Isnt there a risk of generating system comands with the leveraging of null values&#8230;  What if 2 nulls occur in a row&#8230;  Can that be inturpreted as an end of test by the system?  not too sure what happens under the hood of SQL2k5 but from a programming perspective&#8230;   just a thought&#8230;</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
