You are here: Re: ORDER BY in VIEW not working « MsSQL Server « IT news, forums, messages
Re: ORDER BY in VIEW not working

Posted by Erland Sommarskog on 03/23/06 00:33

Herb Caudill (herb@caudillweb.com) writes:
> The fact of the matter is that SQL server used to work the way most
> naïve users would expect it to work - that is, views and functions with
> an ORDER BY clause returned ordered results. This worked 100% of the
> time in my experience, and I depended on it. The fact that there was a
> footnote in an RFC or a technical specification somewhere the explained
> that this was not guaranteed is beside the point; as far as I'm
> concerned this is a breach of backward compatibility, and your
> explanation that the new approach gives me better query optimization
> does not interest me at all.

Permit me to point that it is a matter of a "footnote", but a very
basic property of SQL. queries return tables, and tables are unordered
sets. If you need a certain order from a query, you need to use ORDER BY.
This apply to all RDBMS products.

This is no stranger that in a C program you should initialize all your
variables, although you in some cases can assume that will have a certain
value.



By the wau, I would like to express the hope that you in some few years
will start to care about performance. Because that would mean that your
business has taken off.

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

Navigation:

[Reply to this 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

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