SQL querry of the non-latin characters without N prefix

We are able to querry texts including non-latin characters (like; Turkish, Chineese, Russian..etc) in Where conditions with the help of N prefix or nvarchar cast operations via SQL as below ;

SELECT *  FROM DBNAME..TABLENAME  WHERE COLUMNNAME LIKE N'%Şikayet%' 

But how to querry if we are using a variable (in a function, procedure..etc) ? With the help of varbinary casting operation we can querry with success;



DECLARE @VARIABLE NVARCHAR(MAX)
SET @VARIABLE='Şikayet'

SELECT *  FROM DBNAME..TABLENAME  WHERE CAST(COLUMNNAME AS varbinary(10)) LIKE CAST(@VARIABLE AS varbinary(10)) 

2 comments:

  1. The truth is that learning OpenCV used to be quite challenging. The documentation was hard to navigate. The tutorials were hard to follow and incomplete. And even some of the books were a bit tedious to work through. if anyone wants to learn programming then you can also checkout these best computer vision courses

    ReplyDelete
  2. A prefix is an affix which is placed before the stem of a word. Adding it to the beginning of one word changes it into another word. For example, when the prefix un- is added to the word happy, it creates the word unhappy.

    ReplyDelete

© 2011-2015 | EmreCiftci.net. Powered by Blogger.