To elaborate on what Jon said, Sql Server tables are sets. Yes, they
are visualized with an "order", but that visualization is implying something
that is not the case. When you insert rows into SQL Server, there is no
order to how they appear in the table. Yes, there is a physical
implementation of how the rows are stored, and there is an order to that,
but that order is not guaranteed.
This is why Jon's recommendation works, and you will have to do this
every time you query the data. You have to apply the sort that makes sense
to your application.
As a general recommendation, when working with data in SQL Server, don't
think of it in terms of tables (which have an implicit order from top to
bottom, and which also imply thinking in terms of cursors, which have an
order of traversal). Rather, you have to think about it in terms of set
operations.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
If you want a particular order, you should have a column in your table
which you sort by, and make sure that you insert entries with
appropriate values for that column.
- Show quoted text -