Reply to Re: SQL Server 2005 order by date does not sort properly

Your name:

Reply:


Posted by Plamen Ratchev on 02/01/07 06:10

Just to add-on to Dan's response: in SQL Server 2000 using ORDER BY and TOP
100 PERCENT in views seemed to be a loophole that worked fine. In SQL Server
2005 that has been corrected and ORDER BY does not guarantee ordered
results. This is described very well in SQL Server 2005 BOL under the
section "Sorting Rows with ORDER BY":

"Although the view definition contains an ORDER BY clause, that ORDER BY
clause is used only to determine the rows returned by the TOP clause. When
querying the view itself, SQL Server does not guarantee the results will be
ordered, unless you specify so explicitly."

Regards,

Plamen Ratchev
http://www.SQLStudio.com

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация