|
Posted by Erland Sommarskog on 03/24/06 01:12
RickW (user=wannall at=@ other=sbcglobal final=.net) writes:
> I am absolutely fascinated by the complete lack of ability of the
> theory-side respondents to differentiate between a thing in SQL Server
> that accidentally has the object name "view", and the theoretical
> construct defined by the term <VIEW>.
>
> Amusingly, the accidental fact that there doesn't happen to be a
> contravening definition of a construct named <STORED PROCEDURE> causes
> them to accept without noticing any contradiction that it therefore
> makes sense for an object in SQL Server with object name "stored
> procedure" to return an ordered set.
>
> Theory absolutely rules, right up to that layer where the tool meets the
> real world. Right there, at that interface, you start accommodating how
> a thing must be used (user interface), by adapting the things that must
> work a certain way (underlying mechanisms).
>
> Failure to do so leads to the kind of nonesense that just happened with
> ORDER BY.
When you want a query against a view to return data in a order as
defined in a view, you are not asking for a view, you are asking for
a stored query. Which is essentially is a stored procedure.
But, yes, if you insist on that to equat views with stored procedures
it will lead to nonsense.
Each trade has its fundamentals, one fundamental in SQL is that if you
want an order from query, you must use ORDER BY. You can call it theory
if you like. But it's really more like "that's the way it works".
--
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
[Back to original message]
|