You are here: Re: Insert a record in a particular place « MsSQL Server « IT news, forums, messages
Re: Insert a record in a particular place

Posted by David Portas on 05/28/06 13:12

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
--

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация