Re: Compound Primary Key - order not as expected
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Fri, 28 Apr 2006 21:44:38 +0000 (UTC)
John Rivers (first10@xxxxxxxxxxxxxx) writes:
when a clustered index is present the records *are* physically ordered
on disk to match the index
that is the whole point of a clustered index
Actually, they are ordered if you follow the page links. But if pages
are in disorder, the physical order on disk may be yet another one.
and by default a select statement with no ORDER BY will always return
data in the order of the clustered index (when present)
No. This may have been true by chance for SQL Server up version 6.5. It is
definitely not correct for SQL 7 and later.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
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
.
- Follow-Ups:
- Re: Compound Primary Key - order not as expected
- From: John Rivers
- Re: Compound Primary Key - order not as expected
- References:
- Compound Primary Key - order not as expected
- From: John Rivers
- Re: Compound Primary Key - order not as expected
- From: --CELKO--
- Re: Compound Primary Key - order not as expected
- From: John Rivers
- Compound Primary Key - order not as expected
- Prev by Date: Re: Trigger to encrypt field before write
- Next by Date: Re: Trigger to encrypt field before write
- Previous by thread: Re: Compound Primary Key - order not as expected
- Next by thread: Re: Compound Primary Key - order not as expected
- Index(es):
Relevant Pages
|