4

The code of one of the hebrew characters which is a dot(=vowel) is 1463 or 0x05b7

I try to select only words that contain this character, but I get the whole list of words.

I try:

DECLARE @d NCHAR
set @d = NCHAR(1463)
select * from words where word like '%' + @d + '%'

I tried also

select * from words where word LIKE '%'+NCHAR(0x05B7)+'%'

I tried to finish the statement with

collate hebrew_cs_as

or

collate hebrew_cs_ai

and it's not working

PS when I try the same with a letter code like 1488 it is working fine

eg.

select * from words where word LIKE '%'+NCHAR(1488)+'%'
4

1 回答 1

3

如果您COLLATE将源 nvarchar 作为Latin1_General_BIN

DECLARE @t TABLE(txt NVARCHAR(4000));
INSERT INTO @t(txt)VALUES
    (NCHAR(1463)),(N'abcdef'),(N'aiiy'+NCHAR(1463)+N'skj'),(N'sdljsd'),(N'sdjp'+NCHAR(1463)),(N'sdzf');
SELECT * FROM @t WHERE txt COLLATE Latin1_General_BIN LIKE N'%'+NCHAR(1463)+N'%';

结果:

在此处输入图像描述

于 2016-02-22T07:56:20.643 回答