<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.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>TOP 100 Percent ORDER BY Considered Harmful.</title><link>http://blogs.msdn.com/queryoptteam/archive/2006/03/24/560396.aspx</link><description>(Updated 2006-27-03 9:00am Pacfiic Time - at the bottom) SQL is a declarative language. That means that the language declares the form of the output but not the method used to generate those results. There are cases, however, where the language is not</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: TOP 100 Percent ORDER BY Considered Harmful.</title><link>http://blogs.msdn.com/queryoptteam/archive/2006/03/24/560396.aspx#560403</link><pubDate>Sat, 25 Mar 2006 01:28:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:560403</guid><dc:creator>kizzer</dc:creator><description>Man, that explains a lot! &amp;nbsp;
&lt;br&gt;I've never seen this issue explained so well.
&lt;br&gt;...Off to fix dubiously constructed views! 
&lt;br&gt;</description></item><item><title>re: TOP 100 Percent ORDER BY Considered Harmful.</title><link>http://blogs.msdn.com/queryoptteam/archive/2006/03/24/560396.aspx#560641</link><pubDate>Sat, 25 Mar 2006 08:22:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:560641</guid><dc:creator>Gaurav Bindlish</dc:creator><description>Excellent Post .....&lt;br&gt;&lt;br&gt;I get the part where TOP 100 was ignored. I am curious as to why the ORDER BY clause in the view definition was ignored.</description></item><item><title>Viste ordinate in SQL Server: trucchi inutili</title><link>http://blogs.msdn.com/queryoptteam/archive/2006/03/24/560396.aspx#561207</link><pubDate>Sun, 26 Mar 2006 10:45:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:561207</guid><dc:creator>Marco Russo</dc:creator><description>Mi &amp;amp;#232; capitato di frequente di vedere l'uso della clausola TOP 100 PERCENT usato nella definizione di...</description></item><item><title>re: TOP 100 Percent ORDER BY Considered Harmful.</title><link>http://blogs.msdn.com/queryoptteam/archive/2006/03/24/560396.aspx#679873</link><pubDate>Thu, 27 Jul 2006 08:29:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:679873</guid><dc:creator>mcdrewski</dc:creator><description>Trying to create a view which orders (CREATE VIEW blah AS SELECT A,B,C FROM X ORDER BY A) gives : &amp;quot;The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP or FOR XML is also specified.&amp;quot;&lt;br&gt;&lt;br&gt;But above you say that if TOP and ORDER BY are specified then ORDER BY is (euphemism alert) &amp;quot;optimised&amp;quot; out. &amp;nbsp;Therefore, I don't understand how this is consistent. &amp;nbsp;The error may as well say &amp;quot;The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions&amp;quot;, since if it can never be honoured it may as well be illegal.&lt;br&gt;&lt;br&gt;I guess the SQLServer way to implement data hiding (yes, we use views for this purpose where order is important) is not to use views but to implement all views as stored procedures which do the same thing.&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</description></item><item><title>Query Processing -- introduction to the blog!</title><link>http://blogs.msdn.com/queryoptteam/archive/2006/03/24/560396.aspx#771428</link><pubDate>Tue, 26 Sep 2006 03:52:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:771428</guid><dc:creator>Tips, Tricks, and Advice from the SQL Server Query Processing Team</dc:creator><description>Since we’re starting a new blog for the whole query processing team, we think it’s appropriate to start...</description></item><item><title>re: [SQL] Le viste ordinate non si fanno!</title><link>http://blogs.msdn.com/queryoptteam/archive/2006/03/24/560396.aspx#774038</link><pubDate>Wed, 27 Sep 2006 20:27:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:774038</guid><dc:creator>Andrea Benedetti</dc:creator><description /></item><item><title>Exploring the secrets of intermediate materialization</title><link>http://blogs.msdn.com/queryoptteam/archive/2006/03/24/560396.aspx#788754</link><pubDate>Wed, 04 Oct 2006 09:31:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:788754</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;When working with SQL Server 2000, I used to have this little trick I'd pull out after exhausting all...&lt;/p&gt;
</description></item><item><title>Exploring the secrets of intermediate materialization</title><link>http://blogs.msdn.com/queryoptteam/archive/2006/03/24/560396.aspx#788755</link><pubDate>Wed, 04 Oct 2006 09:31:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:788755</guid><dc:creator>adam machanic :: data manipulation for fun and profit</dc:creator><description>&lt;p&gt;When working with SQL Server 2000, I used to have this little trick I'd pull out after exhausting all...&lt;/p&gt;
</description></item><item><title>Exploring the secrets of intermediate materialization</title><link>http://blogs.msdn.com/queryoptteam/archive/2006/03/24/560396.aspx#1435366</link><pubDate>Mon, 08 Jan 2007 22:19:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1435366</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;When working with SQL Server 2000, I used to have this little trick I'd pull out after exhausting all&lt;/p&gt;
</description></item><item><title>TOP 100 Percent ORDER BY Considered Harmful</title><link>http://blogs.msdn.com/queryoptteam/archive/2006/03/24/560396.aspx#2207899</link><pubDate>Fri, 20 Apr 2007 17:42:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2207899</guid><dc:creator>SSQA- Users &amp; SQL tools</dc:creator><description>&lt;p&gt;TOP 100 Percent ORDER BY Considered Harmful Straight to the subject about how it works in SQL 2000 &amp;amp;amp;&lt;/p&gt;
</description></item><item><title>More on TOP</title><link>http://blogs.msdn.com/queryoptteam/archive/2006/03/24/560396.aspx#4171754</link><pubDate>Wed, 01 Aug 2007 19:19:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4171754</guid><dc:creator>Craig Freedman's WebLog</dc:creator><description>&lt;p&gt;Last week I wrote about a special case of the TOP operator known as ROWCOUNT TOP . This week I'll take&lt;/p&gt;
</description></item><item><title>No Seatbelt - Expecting Order without ORDER BY</title><link>http://blogs.msdn.com/queryoptteam/archive/2006/03/24/560396.aspx#8902388</link><pubDate>Thu, 28 Aug 2008 05:46:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8902388</guid><dc:creator>Conor vs. SQL</dc:creator><description>&lt;p&gt;One of the greatest lessons I've learned in building software is that every technical implementation&lt;/p&gt;
</description></item><item><title>Sortierung in View nach Umstellung auf SQL-Server 2005 | hilpers</title><link>http://blogs.msdn.com/queryoptteam/archive/2006/03/24/560396.aspx#9347452</link><pubDate>Tue, 20 Jan 2009 17:39:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9347452</guid><dc:creator>Sortierung in View nach Umstellung auf SQL-Server 2005 | hilpers</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.hilpers.com/1005357-sortierung-in-view-nach-umstellung"&gt;http://www.hilpers.com/1005357-sortierung-in-view-nach-umstellung&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>View ORDER BY lost on web | keyongtech</title><link>http://blogs.msdn.com/queryoptteam/archive/2006/03/24/560396.aspx#9364964</link><pubDate>Thu, 22 Jan 2009 11:41:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9364964</guid><dc:creator>View ORDER BY lost on web | keyongtech</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.keyongtech.com/2150129-view-order-by-lost-on"&gt;http://www.keyongtech.com/2150129-view-order-by-lost-on&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>cf_flotsam  &amp;raquo; Blog Archive   &amp;raquo; order by clause not working in sql server view</title><link>http://blogs.msdn.com/queryoptteam/archive/2006/03/24/560396.aspx#9572777</link><pubDate>Tue, 28 Apr 2009 05:26:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9572777</guid><dc:creator>cf_flotsam  &amp;raquo; Blog Archive   &amp;raquo; order by clause not working in sql server view</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.smallbis.com.au/cf_flotsam/2008/11/order-by-clause-not-working-in-sql-server-view/"&gt;http://www.smallbis.com.au/cf_flotsam/2008/11/order-by-clause-not-working-in-sql-server-view/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title> Tips Tricks and Advice from the SQL Server Query Optimization Team | Paid Surveys</title><link>http://blogs.msdn.com/queryoptteam/archive/2006/03/24/560396.aspx#9683885</link><pubDate>Tue, 02 Jun 2009 09:51:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9683885</guid><dc:creator> Tips Tricks and Advice from the SQL Server Query Optimization Team | Paid Surveys</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://paidsurveyshub.info/story.php?id=62596"&gt;http://paidsurveyshub.info/story.php?id=62596&lt;/a&gt;&lt;/p&gt;
</description></item><item><title> Tips Tricks and Advice from the SQL Server Query Optimization Team | Insomnia Cure</title><link>http://blogs.msdn.com/queryoptteam/archive/2006/03/24/560396.aspx#9719112</link><pubDate>Wed, 10 Jun 2009 03:15:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9719112</guid><dc:creator> Tips Tricks and Advice from the SQL Server Query Optimization Team | Insomnia Cure</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://insomniacuresite.info/story.php?id=6587"&gt;http://insomniacuresite.info/story.php?id=6587&lt;/a&gt;&lt;/p&gt;
</description></item><item><title> Tips Tricks and Advice from the SQL Server Query Optimization Team | debt settlement program</title><link>http://blogs.msdn.com/queryoptteam/archive/2006/03/24/560396.aspx#9753952</link><pubDate>Mon, 15 Jun 2009 20:08:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9753952</guid><dc:creator> Tips Tricks and Advice from the SQL Server Query Optimization Team | debt settlement program</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://edebtsettlementprogram.info/story.php?id=24591"&gt;http://edebtsettlementprogram.info/story.php?id=24591&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>