|
|
|
date: Thu, 28 Jul 2005 06:36:05 -0700,
group: microsoft.public.sqlserver.programming
back
RE: SQL Server means 'Ã' = 'ss' is TRUE. What's wrong?
Hi
DIN, SQL ANSI-92 and ISO standards all dictate that the "sharp s" evalutes
to "ss". It is nothing you can change in the DB. SQL Server is just following
the standards.
Regards
--------------------------------
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Klaus" wrote:
> Hello,
>
> in a case-function the therm 'ß' = 'ss' evaluates to true. Is there a chance
> to fix the problen in a particular query or better to fix it generally in SQL
> Server?
>
> Thanks in advance,
> Klaus
>
> SQL Server Version: 8.00.760 (SP3)
> Language: german
> Collation: Latin1_General_CI_AS
>
> Sample SQL statement to reproduce the behavior:
>
> select case when 'ss' = 'ß' then 'ss = ß!' else 'ok' end as 'Test ss=ß',
> case when 'ss' = 's' then 'ss = s!' else 'ok' end as 'Test ss=s',
> case when 'ae' = 'ä' then 'ae = ä!' else 'ok' end as 'Test ae=ä',
> case when 'oe' = 'ö' then 'oe = ö!' else 'ok' end as 'Test oe=ö',
> case when 'ue' = 'ü' then 'ue = ü!' else 'ok' end as 'Test ue=ü'
>
> Resultset in our environment:
> Test ss=ß Test ss=s Test ae=ä Test oe=ö Test ue=ü
> --------- --------- --------- --------- ---------
> ss = ß! ok ok ok ok
>
date: Thu, 28 Jul 2005 06:42:04 -0700
author: Mike Epprecht (SQL MVP)
'ß'Re: SQL Server means = 'ss' is TRUE. What's
wrong?
Klaus,
Just create a table, insert all values you like to see sorted, and use
the COLLATE keyword in the ORDER BY clause.
Note that you are not required to change the column collation in the
database. You can also use the COLLATE keyword for any predicate and
ORDER expression. However, in those cases indexes cannot be fully used.
So you could write something like
WHERE Test = 'ß' COLLATE Latin1_General_BIN
but still keep the column collation on Latin1_General_CI_AS, so any
ordering will be unchanged.
HTH,
Gert-Jan
Klaus wrote:
>
> Sorry, I've only tested Latin1_General_BIN - shame on me!
>
> Yes, SQL_Latin1_General_CP1_CI_AS also evaluates the difference between 'ss'
> and 'ß' but sorts in th first tests the same way like Latin1_General_CI_AS.
>
> Is there a documentation of the collations to see the differences between
> Latin1_General_CI_AS and SQL_Latin1_General_CP1_CI_AS and if so, where can I
> get it?
date: Thu, 28 Jul 2005 19:53:45 +0200
author: Gert-Jan Strik
|
|