Re: Insert a record in a particular place
- From: "David Portas" <REMOVE_BEFORE_REPLYING_dportas@xxxxxxx>
- Date: 28 May 2006 03:12:03 -0700
Ralph Ganszky wrote:
How do you know that the OP asked exactly what you expect he have asked? Are
you sure that he asked what you think/want he has asked? What I meant is
exactly what he asked from my point of view. He asked if it is possible to
insert in between two other records. A clustered index does exactly this on
row level. It has on the other side nothing to do with the order in the
result set as you mentioned. But the answer is true any way for the physical
representation on the disk.
Only partly right. A clustered index will give rows a positional order
that can be reconstructed internally in the clustered index. However,
that order is normally inaccessible to the user. Your statement that
this is a physical order on disk is misleading. There need not be any
such physical ordering and even if it exists initially there is no
guarantee it will be maintained by a clustered index.
To refer to this in the way you did (an "ordered table") without any
qualification or explanation is to invite confusion. A table is a
logical model concept and definitively does not have a logical ordering
- not even given the faults and features of SQL and T-SQL. It's
difficult to see how a clustered index answers the original question
(if the OP wasn't aware of clustered indexes then how could he be
asking a question about their internal ordering?) but even if it did, I
wanted to clear up any confusion about the phrase "ordered table".
--
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
--
.
- Follow-Ups:
- Re: Insert a record in a particular place
- From: Hugo Kornelis
- Re: Insert a record in a particular place
- References:
- Insert a record in a particular place
- From: surya
- Re: Insert a record in a particular place
- From: David Portas
- Re: Insert a record in a particular place
- From: Ralph Ganszky
- Re: Insert a record in a particular place
- From: David Portas
- Re: Insert a record in a particular place
- From: Ralph Ganszky
- Insert a record in a particular place
- Prev by Date: Re: Insert a record in a particular place
- Next by Date: Re: T-SQL CLOSE Connection to DB
- Previous by thread: Re: Insert a record in a particular place
- Next by thread: Re: Insert a record in a particular place
- Index(es):
Relevant Pages
|