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)
 Sorting order and åäö

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-02-11 : 08:55:56
Kajsa writes "I want to order my select from a person table by lastname. The problem is that the swedish characters åäö is not sorted correctly. å and ä is mixed with a and ö with o. åäö is really the last characters in the alphabet. I have set the language to Svenska but that doesn't help.

The output of:
SELECT LastName FROM Person
is:
------------------------------
Ågren
Andersson
Ärlandsson
Östergren
Svensson

when it shuld be:
------------------------------
Andersson
Svensson
Ågren
Ärlandsson
Östergren

/Kajsa"

andre
Constraint Violating Yak Guru

259 Posts

Posted - 2002-02-11 : 09:34:33
You're missing an ORDER BY clause in your SQL Statement. It should be:
SELECT LastName FROM Person ORDER BY LastName 


Go to Top of Page

hesta96
Starting Member

9 Posts

Posted - 2002-02-11 : 10:55:13
Andre is right, but be shore that you have Finnish-Swedish Collation for the database.

/Henrik Stahle

Go to Top of Page

monkeybite
Posting Yak Master

152 Posts

Posted - 2002-02-11 : 13:19:22
If your database is SQL 7.0, and you didn't select the Finnish-Swedish collation on install, you will have to uninstall and reinstall SQL Server with the new collation. This may not be an easy or simple task.

Hopefully your are using SQL 2000, you can set the collation per database or column, for example on the [LastName] column in your [Person] table.

--monkeybite

Go to Top of Page

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2002-12-02 : 02:01:11
or you should be able to do this:

select lastname from person order by lastname collate SQL_Scandinavian_CP850_CI_AS



--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"
Go to Top of Page
   

- Advertisement -