Posted by Ed Murphy on 04/22/07 06:01
Dimitri Furman wrote:
> SQL Server 2000 SP4.
>
> Running the script below prints 'Unexpected':
>
> -----------------------------
> DECLARE @String AS varchar(1)
>
> SELECT @String = 'z'
>
> IF @String LIKE '[' + CHAR(32) + '-' + CHAR(255) + ']'
> PRINT 'Expected'
> ELSE
> PRINT 'Unexpected'
> -----------------------------
>
> If the @String variable is set to 'y' (or in fact any ANSI character other
> than 'z'), the result is 'Expected'. The comparison also evaluates as
> expected if CHAR(255) is replaced with CHAR(254). The server collation, if
> that matters, is SQL_Latin1_General_CP1_CI_AS.
>
> It would be helpful to find the explanatin of this behavior. Thanks.
CHAR(255) = 'y' with an umlaut
http://englishplus.com/xascii.htm
Navigation:
[Reply to this message]
|