|  | Posted by Ralph Ganszky on 05/28/06 10:07 
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@acm.org> wrote in message news:1148732229.972980.233770@y43g2000cwc.googlegroups.com...
 > Ralph Ganszky wrote:
 >>
 >> I think you can have an ordered table in SQL Server if you are using a
 >> clustering index.
 >>
 >> Regards
 >> Ralph
 >
 > You cannot. That is to say, a table with a clustered index is still not
 > logically ordered.
 >
 > The OP asked how to insert a row between other rows. Although a
 > clustered index might achieve something like that at the page level a
 > clustered index doesn't really answer the original question - there is
 > no way to INSERT rows between each other. The only reliable way to get
 > ordered results from a table is to use ORDER BY when you query the
 > 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
 > --
 >
 
 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. I aggree that in relational logic there is no
 order in a set, but SQL implementation of the relational model are allmost
 allways no strict implementations and have some features which are against
 the relational model from Cod. Especially MS SQL Server have many features
 which are not in the sense of Cod, e.g. the FROM clause in the UPDATE
 statement.
 
 I think the OP can now choose from the replies which answer answers his
 question.
 
 Regards Ralph
  Navigation: [Reply to this message] |