Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Sort problem

Author  Topic 

linda9898
Starting Member

28 Posts

Posted - 2007-04-28 : 14:06:47
Hi ,

I want to sort a table without touching the code as i am not familiar with it. its for a combobox
right now the table sort by the ID, for example
ID Name
1 Sharon
2 Dan
5 Erik
7 Adrian

so i want to sort it by the names at the combobox.
is there any way to do it without going to the code? at the properties of the table at the sql server 2000 ?

thanks,
Linda

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-04-28 : 20:53:24
If you don't want to put order by in your query, need create clustered index on name column. But it's still not guaranteed in parallel query.
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-04-28 : 21:52:07
the only way to guarantee that it's sorted if you can't change the ORDER BY in the query is to sort on the client.


www.elsasoft.org
Go to Top of Page

LoztInSpace
Aged Yak Warrior

940 Posts

Posted - 2007-04-30 : 05:12:17
Without understanding it you might just end up breaking something (what if something makes use of the list index, not the ID? Or assumes the ID is decending?)
I can heartily recommend not making changes to code you do not understand. Therefore your first step must be to understand it. Then you can make the change.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-04-30 : 05:15:02
Or, create a new VIEW with an ORDER BY included...


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-04-30 : 05:22:59
Or do it in the front-end!

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-04-30 : 14:20:42
quote:
Originally posted by Peso

Or, create a new VIEW with an ORDER BY included...


Peter Larsson
Helsingborg, Sweden



this is not a reliable method, even though it's commonly used.

see: http://blogs.msdn.com/sqltips/archive/2005/07/20/441053.aspx


www.elsasoft.org
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-06-20 : 10:05:18
quote:
Originally posted by linda9898

Hi ,

I want to sort a table without touching the code as i am not familiar with it. its for a combobox
right now the table sort by the ID, for example
ID Name
1 Sharon
2 Dan
5 Erik
7 Adrian

so i want to sort it by the names at the combobox.
is there any way to do it without going to the code? at the properties of the table at the sql server 2000 ?

thanks,
Linda



What is the front end?
Set the sorted Property of the Combo box to True

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -