Posted by Dan Guzman on 02/01/07 03:43
The bottom line is that you should treat tables and views as unordered sets
or rows. SQL Server does not honor the ORDER BY specification in a view for
result set ordering. If you need an ordered result, you must specify ORDER
BY when selecting from the view/table.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Jer" <jerry.w.black@saic.com> wrote in message
news:1170287064.047611.235820@p10g2000cwp.googlegroups.com...
>I am using Access 2003 as a front-end to a SQL Server 2005 database.
> I make design changes using SQL Server Management Studio. I have a
> table that includes a datetime column. I create a view and sort by
> the datetime field. When I initially look at the result it is sorted
> correctly. Then I save the view and re-open it and it is not sorted.
> I've simplified the view so it only contains the date field and it
> still does not sort. Here is the view:
> SELECT TOP (100) PERCENT Period_Date
> FROM dbo.Period_Summary
> ORDER BY Period_Date DESC
>
> The date seems to be a random order.
> I don't have this problem in the SQL Server 2000 version of the
> database.
>
> Help please!
> Thanks,
> Jerry
>
Navigation:
[Reply to this message]
|