<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Interesting Observation &#8211; TOP 100 PERCENT and ORDER BY</title>
	<atom:link href="http://blog.sqlauthority.com/2009/11/24/sql-server-interesting-observation-top-100-percent-and-order-by/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2009/11/24/sql-server-interesting-observation-top-100-percent-and-order-by/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Fri, 10 Feb 2012 02:12:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: javari78</title>
		<link>http://blog.sqlauthority.com/2009/11/24/sql-server-interesting-observation-top-100-percent-and-order-by/#comment-231310</link>
		<dc:creator><![CDATA[javari78]]></dc:creator>
		<pubDate>Wed, 04 Jan 2012 15:59:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7448#comment-231310</guid>
		<description><![CDATA[In 2008 does it still work in stored procedures?]]></description>
		<content:encoded><![CDATA[<p>In 2008 does it still work in stored procedures?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://blog.sqlauthority.com/2009/11/24/sql-server-interesting-observation-top-100-percent-and-order-by/#comment-168088</link>
		<dc:creator><![CDATA[Tim]]></dc:creator>
		<pubDate>Wed, 14 Sep 2011 19:33:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7448#comment-168088</guid>
		<description><![CDATA[Not sure about the hotfix, my workaround was (using Pinal&#039;s sample from above):

SELECT TOP 100 (select count(*) from HumanResources.Shift )  *
FROM HumanResources.Shift
ORDER BY ShiftID DESC]]></description>
		<content:encoded><![CDATA[<p>Not sure about the hotfix, my workaround was (using Pinal&#8217;s sample from above):</p>
<p>SELECT TOP 100 (select count(*) from HumanResources.Shift )  *<br />
FROM HumanResources.Shift<br />
ORDER BY ShiftID DESC</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mohammad</title>
		<link>http://blog.sqlauthority.com/2009/11/24/sql-server-interesting-observation-top-100-percent-and-order-by/#comment-99844</link>
		<dc:creator><![CDATA[Mohammad]]></dc:creator>
		<pubDate>Sun, 14 Nov 2010 22:46:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7448#comment-99844</guid>
		<description><![CDATA[Hi all,

TOP 100 PERCENT doesn&#039;t work for me on SQL 2008 R2, so I have used TOP 99.99 PERCENT to fix the issue. 

Has anyone tried to install the Microsoft hotfix for this? 

Cheers :)
Mohammad]]></description>
		<content:encoded><![CDATA[<p>Hi all,</p>
<p>TOP 100 PERCENT doesn&#8217;t work for me on SQL 2008 R2, so I have used TOP 99.99 PERCENT to fix the issue. </p>
<p>Has anyone tried to install the Microsoft hotfix for this? </p>
<p>Cheers :)<br />
Mohammad</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gue</title>
		<link>http://blog.sqlauthority.com/2009/11/24/sql-server-interesting-observation-top-100-percent-and-order-by/#comment-85755</link>
		<dc:creator><![CDATA[gue]]></dc:creator>
		<pubDate>Tue, 31 Aug 2010 08:20:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7448#comment-85755</guid>
		<description><![CDATA[Hi Mahboubeh,

Using TOP 99.99 PERCENT or large integer was producing another issue such as performance.


regards,

gue]]></description>
		<content:encoded><![CDATA[<p>Hi Mahboubeh,</p>
<p>Using TOP 99.99 PERCENT or large integer was producing another issue such as performance.</p>
<p>regards,</p>
<p>gue</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mahboubeh</title>
		<link>http://blog.sqlauthority.com/2009/11/24/sql-server-interesting-observation-top-100-percent-and-order-by/#comment-66850</link>
		<dc:creator><![CDATA[Mahboubeh]]></dc:creator>
		<pubDate>Mon, 26 Apr 2010 08:30:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7448#comment-66850</guid>
		<description><![CDATA[Hi All,
You can use:  
 &quot; Top (99) Percent&quot; 
 or 

&quot;Top (200000000)&quot; I mean a large number that is 1000 times more than your selection records and be sure that all of your selection would be ruturned.
It works!
Just Try It.

:)

Best Regards, 
Mahboubeh J.]]></description>
		<content:encoded><![CDATA[<p>Hi All,<br />
You can use:<br />
 &#8221; Top (99) Percent&#8221;<br />
 or </p>
<p>&#8220;Top (200000000)&#8221; I mean a large number that is 1000 times more than your selection records and be sure that all of your selection would be ruturned.<br />
It works!<br />
Just Try It.</p>
<p>:)</p>
<p>Best Regards,<br />
Mahboubeh J.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Tkatch</title>
		<link>http://blog.sqlauthority.com/2009/11/24/sql-server-interesting-observation-top-100-percent-and-order-by/#comment-59579</link>
		<dc:creator><![CDATA[Brian Tkatch]]></dc:creator>
		<pubDate>Mon, 11 Jan 2010 14:54:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7448#comment-59579</guid>
		<description><![CDATA[@Probal Roy

To be emailed changed on a particular post, replay to this message, and check the option &quot;Notify me of new posts via email.&quot;.]]></description>
		<content:encoded><![CDATA[<p>@Probal Roy</p>
<p>To be emailed changed on a particular post, replay to this message, and check the option &#8220;Notify me of new posts via email.&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Probal Roy</title>
		<link>http://blog.sqlauthority.com/2009/11/24/sql-server-interesting-observation-top-100-percent-and-order-by/#comment-59535</link>
		<dc:creator><![CDATA[Probal Roy]]></dc:creator>
		<pubDate>Sun, 10 Jan 2010 08:14:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7448#comment-59535</guid>
		<description><![CDATA[Please notify me of new posts via email.]]></description>
		<content:encoded><![CDATA[<p>Please notify me of new posts via email.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://blog.sqlauthority.com/2009/11/24/sql-server-interesting-observation-top-100-percent-and-order-by/#comment-58065</link>
		<dc:creator><![CDATA[Steve]]></dc:creator>
		<pubDate>Tue, 01 Dec 2009 14:46:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7448#comment-58065</guid>
		<description><![CDATA[This is not a bug; it was removed on purpose:

http://blogs.msdn.com/queryoptteam/archive/2006/03/24/560396.aspx

And there are workarounds, such as the following from Adam Machanic:

http://sqlblog.com/blogs/adam_machanic/archive/2006/10/03/exploring-the-secrets-of-intermediate-materialization.aspx]]></description>
		<content:encoded><![CDATA[<p>This is not a bug; it was removed on purpose:</p>
<p><a href="http://blogs.msdn.com/queryoptteam/archive/2006/03/24/560396.aspx" rel="nofollow">http://blogs.msdn.com/queryoptteam/archive/2006/03/24/560396.aspx</a></p>
<p>And there are workarounds, such as the following from Adam Machanic:</p>
<p><a href="http://sqlblog.com/blogs/adam_machanic/archive/2006/10/03/exploring-the-secrets-of-intermediate-materialization.aspx" rel="nofollow">http://sqlblog.com/blogs/adam_machanic/archive/2006/10/03/exploring-the-secrets-of-intermediate-materialization.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ray</title>
		<link>http://blog.sqlauthority.com/2009/11/24/sql-server-interesting-observation-top-100-percent-and-order-by/#comment-57919</link>
		<dc:creator><![CDATA[Ray]]></dc:creator>
		<pubDate>Thu, 26 Nov 2009 04:21:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7448#comment-57919</guid>
		<description><![CDATA[This is also a problem in SQL 2005]]></description>
		<content:encoded><![CDATA[<p>This is also a problem in SQL 2005</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ted</title>
		<link>http://blog.sqlauthority.com/2009/11/24/sql-server-interesting-observation-top-100-percent-and-order-by/#comment-57860</link>
		<dc:creator><![CDATA[Ted]]></dc:creator>
		<pubDate>Tue, 24 Nov 2009 12:49:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7448#comment-57860</guid>
		<description><![CDATA[This  was classified a bug by microsoft and has been fixed in a hot fix ( http://support.microsoft.com/kb/926292)  which was rolled up in Cumulative update package 1 for SQL Server 2008

http://support.microsoft.com/kb/956717/]]></description>
		<content:encoded><![CDATA[<p>This  was classified a bug by microsoft and has been fixed in a hot fix ( <a href="http://support.microsoft.com/kb/926292" rel="nofollow">http://support.microsoft.com/kb/926292</a>)  which was rolled up in Cumulative update package 1 for SQL Server 2008</p>
<p><a href="http://support.microsoft.com/kb/956717/" rel="nofollow">http://support.microsoft.com/kb/956717/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pinaldave</title>
		<link>http://blog.sqlauthority.com/2009/11/24/sql-server-interesting-observation-top-100-percent-and-order-by/#comment-57857</link>
		<dc:creator><![CDATA[pinaldave]]></dc:creator>
		<pubDate>Tue, 24 Nov 2009 12:33:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7448#comment-57857</guid>
		<description><![CDATA[Hi Luciano,

This option will not work. Try following script out. It will not work. The whole behavior is not support with or without TIES.

CREATE VIEW vwShift_ties
AS 
SELECT TOP 100 PERCENT WITH TIES *
FROM HumanResources.Shift
ORDER BY ShiftID DESC
GO
-- Select From View
SELECT *
FROM vwShift_ties
GO

Kind Regards,
Pinal]]></description>
		<content:encoded><![CDATA[<p>Hi Luciano,</p>
<p>This option will not work. Try following script out. It will not work. The whole behavior is not support with or without TIES.</p>
<p>CREATE VIEW vwShift_ties<br />
AS<br />
SELECT TOP 100 PERCENT WITH TIES *<br />
FROM HumanResources.Shift<br />
ORDER BY ShiftID DESC<br />
GO<br />
&#8211; Select From View<br />
SELECT *<br />
FROM vwShift_ties<br />
GO</p>
<p>Kind Regards,<br />
Pinal</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luciano Evaristo Guerche (Gorše)</title>
		<link>http://blog.sqlauthority.com/2009/11/24/sql-server-interesting-observation-top-100-percent-and-order-by/#comment-57856</link>
		<dc:creator><![CDATA[Luciano Evaristo Guerche (Gorše)]]></dc:creator>
		<pubDate>Tue, 24 Nov 2009 12:03:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7448#comment-57856</guid>
		<description><![CDATA[Hi Pinal,

As far as I remember, when using &quot;TOP 100 PERCENT&quot; clause, one must include &quot;WITH TIES&quot; to assure all rows are returned (http://technet.microsoft.com/en-us/library/ms189463.aspx)

Regards,]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,</p>
<p>As far as I remember, when using &#8220;TOP 100 PERCENT&#8221; clause, one must include &#8220;WITH TIES&#8221; to assure all rows are returned (<a href="http://technet.microsoft.com/en-us/library/ms189463.aspx" rel="nofollow">http://technet.microsoft.com/en-us/library/ms189463.aspx</a>)</p>
<p>Regards,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kalicharan</title>
		<link>http://blog.sqlauthority.com/2009/11/24/sql-server-interesting-observation-top-100-percent-and-order-by/#comment-57851</link>
		<dc:creator><![CDATA[Kalicharan]]></dc:creator>
		<pubDate>Tue, 24 Nov 2009 04:10:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7448#comment-57851</guid>
		<description><![CDATA[Hi Mr.Dave,

               Good Morning. I am new in sql 2008 before that i have 2 years experience in Sql 2000. I am working at Private concern as Software Engineer.
             
                In oracle we can create a JAVA class file and we can call that JAVA file in procedure, functions and packages also. My doubt is same like Can we create C# class file in Sql 2008. If possible pls explain if you have a time....


Bye

Thanks &amp; Regards
Kalicharan]]></description>
		<content:encoded><![CDATA[<p>Hi Mr.Dave,</p>
<p>               Good Morning. I am new in sql 2008 before that i have 2 years experience in Sql 2000. I am working at Private concern as Software Engineer.</p>
<p>                In oracle we can create a JAVA class file and we can call that JAVA file in procedure, functions and packages also. My doubt is same like Can we create C# class file in Sql 2008. If possible pls explain if you have a time&#8230;.</p>
<p>Bye</p>
<p>Thanks &amp; Regards<br />
Kalicharan</p>
]]></content:encoded>
	</item>
</channel>
</rss>

