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 2005 Forums
 Transact-SQL (2005)
 order by does not work

Author  Topic 

mikehac
Starting Member

1 Post

Posted - 2008-11-23 : 04:20:35
Hello there.
I've wrote a simple query:
select * from tblTimeSheetProject where project_user_id=5916
order by project_name ASC
When I run it, I receive partially sorted results,for example:
project_name
Alex
Buty
...
ZaZ
Axel
bad
...
zad

I thought that there is some carriage return in project_name field,so I deleted its value in some row(in second sorting group) and wrote it manually (not copy+paste),but it still the same result as befor. Can anybody tell what the problem could be?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-23 : 12:25:53
it might be because of collation setting. can you check the collation setting for column project_name and post back?
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2008-11-24 : 01:45:57
The only one that looks like a problem is Axel which should be after Alex.
Can you post the ascii values for the value - just the first couple of bytes would do.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -