Re: top keyword and sorting
<paulshealy1@gmail.com> wrote in message
news:1112105115.205877.260460@f14g2000cwb.googlegr oups.com...
> David,
>
> Thanks for the response. Your thinking matches mine. Perhaps this
> person was confused because many TOP queries are sorted for some other
> reason - e.g., an ORDER BY or a clustered index.
>
Be careful - you can't rely on a clustered index to return data in a certain
order; the only guaranteed way to get ordered data is using ORDER BY. This
is because MSSQL may choose some way of optimizing your query which doesn't
return data in the order of the clustered index, so if you need ordered data
you always need ORDER BY.
Simon |