SQL Server - searching for a string with international characters using the LIKE clause

I have a "Description" field, which can contain product descriptions with any unicode characters. If I search for a description that contains an international character, with the LIKE clause (a search for a word with no international character), I get the following results:

Example: GEWÜRZTRAMINER- one of the descriptions. When I do this:

Select * from table where Description LIKE '%GEWURZTRAMINER%', it retrieves the entry.

When I do this:

Select * from table where Description LIKE '%GEWURZ%', the entry is not retrieved.

(Note: the search term does not include Ü, but has U)

Is there any way around this so that I can get with "% GEWURZ%"?

+3
source share
2 answers

bog standard varchar

Select 1 where 'GEWÜRZTRAMINER' COLLATE LATIN1_GENERAL_CI_AI LIKE '%GEWURZTRAMINER%'

, SQL.

+5

. , , , SQL_Latin1_General_CP1_CI_AI

+1

Source: https://habr.com/ru/post/1740206/


All Articles