Re: ORDER BY in VIEW not working



Beowulf wrote:

> So, it's just a coincidence (or perhaps luck) that in other views (see
> below) the ORDER BY is respected and the rows returned by the view are
> sorted in the specified order?
>

You could call it luck, yes. SQL Server 2000 usually seems to respect
the order defined in the view, even though there is no formal guarantee
that it always will. SQL Server 2005 added some engine improvements
that seem to make it less likely that the view order will be preserved
- no problem as long as you observe the documented convention that a
SELECT without ORDER BY is unordered.

--
David Portas, SQL Server MVP

Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.

SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--

.



Relevant Pages

  • Re: General Question: Single Quotes in Text Fields
    ... StoredPrcedure in the SQL server, when single quote involved. ... Good Luck ... to morph apostrophes into some other character or just delete them ...
    (microsoft.public.access.modulesdaovba)
  • Provider not found
    ... occur with any ODBC or SQL based database, not just MS SQL Server. ... controls connected to a Sybase database. ... I re-applied the SQL server SP 3 - no luck ... I found these in my i386 folder. ...
    (microsoft.public.sqlserver.odbc)
  • Re: Dynamic Table Name is Source Query
    ... >lookup books and other source for few days and still out of luck. ... Then use a dynamic properties task to take the global variable and ... assign it to the SourceObjectName property of your DataPump task. ... DTS - http://www.sqldts.com PASS - the definitive, global community for SQL Server professionals ...
    (microsoft.public.sqlserver.dts)
  • Re: Need help with ASP.NET website administration tool! - Cant connect to the database when clic
    ... I have done as you directed but no luck ... Here is the ConnectionStrings code from the machine.config file ... DEV is our SQL Server 2000 so I tried using both the servers but no ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: unable to replicate a view or function
    ... there's no mention of dependency algorithms being updated, so I suspect this ... is a coincidence, but who knows - it may be a side-effect of some other ... Paul Ibison SQL Server MVP, ...
    (microsoft.public.sqlserver.replication)