ORDER BY
within a view was only ever a broken "feature" (albeit one that enterprise manager seemed to encourage).
Views are meant, for the most part, to be indistinguishable from Tables. And Tables have no inherent order.
This means that the only place that an ORDER BY
is guaranteed to affect the order in which results are returned is in the outermost SELECT
- i.e. the one that references this view (assuming that that SELECT
, in turn, is not within another view or UDF)
Within a view, UDF, etc, ORDER BY
was only ever meant to work for its other/overloaded purpose - to make TOP
make sense - i.e. without an ORDER BY
, asking for the TOP 10
would be poorly defined, because, again, tables have no inherent order.
Unfortunately, there is a common mis-perception that this works because the Graphical view designers in Enterprise Manager and Management Studio actually encourage it - there are "sort" features included there, and if you use them, the tool inserts TOP 100 PERCENT
and ORDER BY
- despite this having been something that doesn't work since at least 2005.
Having just re-read the question - it was relying on the order of a GROUP BY
? That's compounding one issue with another. There's no guarantee that the output from a statement involving a GROUP BY
will have any particular order.
Yes, SQL Server 2000 x86 can use AWE to buffer data pages above the 4GB limit. See How to configure SQL Server to use more than 2 GB of physical memory:
sp_configure 'show advanced options', 1
RECONFIGURE
GO
sp_configure 'awe enabled', 1
RECONFIGURE
GO
sp_configure 'max server memory', ...
RECONFIGURE
GO
The article also explains how to enable /PAE in boot.ini, but if your OS is amd64 already you don't need it since the OS can already see the entire memory. So all you need is to enable AWE on the x86 SQL Server 2000 instance.
Best Answer
Fair warning, this is tricky. I get it working about 9/10 times these days.
FYI First install the 2005 backward compatibility components, then the DTS components.
I believe both are located here: https://www.microsoft.com/en-us/download/details.aspx?id=24793 but no guarantees.