Groups | Blog | Home
all groups > sql server new users > october 2006 >

sql server new users : Table data sort order


Sue Hoegemeier
10/11/2006 5:13:00 PM
A table by definition is unordered rows and unordered
columns. So the order that things are in the physical
structure of the table really doesn't matter.
The only way to guarantee any ordering for the rows returned
from a table is to use an order by clause. If you have to
use the Open Table functionality in Management Studio, click
on the Show SQL Pane button on the toolbar and add an order
by clause. Other than that, you aren't guaranteed any order.

-Sue

On Wed, 11 Oct 2006 18:50:15 -0400, "Al" <al@newsgroups.com>
[quoted text, click to view]
Al
10/11/2006 6:50:15 PM
I used to work with SQL 200 Enterprise Manager. Now I started to use SQL
2005.
Unlike in SQL 2000, if I open table data is displayed in some strange order
(I even do not know what order is used).
For instance in SQL 2000 all data is displayed in order it was entered in
the table - first inserted record is displayed first. In SQL 2005 the first
entered record may be displayed on the tenth position.
Why is it and how can I change the behavior of Management Studio to display
table data in order it was entered?

Thank you
Esha

Sue Hoegemeier
10/11/2006 8:52:50 PM
Hi Al,
I understand what you are saying. With Enterprise Manager,
when you would do an Open Table, return all rows, it just
executed a Select * from your table. If it appeared to be in
some kind of order, that by chance and not guaranteed. Often
you will see the data displayed based upon the clustered
index so it can appear to be always ordered. If does not
appear to be in an order you expected, that's not really the
tool. It's just how it will work if you don't always specify
an order by.

-Sue

On Wed, 11 Oct 2006 21:58:48 -0400, "Al" <al@newsgroups.com>
[quoted text, click to view]
Al
10/11/2006 9:58:48 PM
Yes, I know that way to sort. But in previous version of SQL there was some
kind of default order - first entered, first displayed. I'm not talking
about views or Select statements in Query Analizer. I'm just talking about
buildin features to display data from the table. I'd like to have the same
in a new tool. What's wrong with my wish?
I wouldn't want to edit anything when I'm opening the table. It was possible
in Enterprise Manager. Why it is not possible in Management Studio? I think
there should be some setting responsible for default order in Management
Studio. I just do not know where to go in order to change that setting.

Thank you

[quoted text, click to view]

AddThis Social Bookmark Button