How to use the "LIKE" statement with unicode strings?

I am trying to execute a request with unicode characters. I was able to execute a regular equality query by adding N to the query (for example: ..... WHERE column=N'exact_stringΓ’' ). But this does not work when I try to use LIKE . Any ideas on how to make this work?

Example query: SELECT * FROM t_sample WHERE t_column LIKE N'%Γ’%'

Also, how can I find out which encoding SQL Server uses to store the nvarchar or nchar data type, and what encoding does it use to display the query in the SQL editor?

EDIT: My bad. It really works. I tried to execute the request in the wrong window. But this is because I learned about collation settings in SQL Server.

+6
sql sql-like unicode sql-server-2005
source share
2 answers

Make sure the collation in the table supports Unicode.

+2
source share

Use the Unicode search bar:

 WHERE CONTRACTORNAME LIKE N'%αΊ‘%' 

Credit

+4
source share

All Articles