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)
 Nvarchar field sorting results are incorrect

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-11-25 : 12:19:43
JB writes "I ran a select statement on a table and ordered the results by a field with datatype nvarchar(100). The results of this select was not as expected.

aaaa
a-aaa
aa'aa
aaaba
aaaba
aa'aba
aaabba
a-aabba

If I rerun the query converting the field to varchar and ordering by the new field the results are as expected.

a-aaa
a-aabba
aa'aa
aa'aba
aaaa
aaaba
aaaba
aaabba

Can anyone shed some light on this?

SQL Server 7 (all service packs)
NT 4 (all service packs)

JB"
   

- Advertisement -