RE: Sorting sequence for table data

RE: Sorting sequence for table data

 

  

Colin,

Often it is the case that a select will bring back the data from a table in
the order it was entered but it is NOT guaranteed to do so.

There is NO guaranteed sort order for data when you just do a select. You
must provide an order by clause if you want to get consistent results.

Hope this helps.



-----Original Message-----
From: Colin Shelton [mailto:Colin.[Email Address Removed] 14 June 2002 11:01
To: Mssqldba (E-mail)
Subject: Sorting sequence for table data


We have recently upgraded from Server 7 to Server 2000. I am getting table
data sorted in a different sequence to how it was ordered in Server 7. It I
do not specify the 'order by' clause, what determines the sequence of the
data in a table when I view it? I would have expected it to be the order
the data was added to the table but that does not appear to be the case. Do
indexes get used or is it something else?

Regards,
Colin Shelton.
IT Services,
UCE, Perry Barr, Birmingham, B42 2SU.
Tel: 0121 331 5665
Email: colin.[Email Address Removed] unsubscribe, e-mail: mssqldba-[Email Address Removed] additional commands, e-mail: mssqldba-[Email Address Removed]MS Sql Server LazyDBA home page