compare encoded japanese characters with japanese character in sql server


  • hi all,

    whenever creating view with the below condition i am not getting any value in the view .

    1.the table contains encoded japanese characters. it was stored as special characters like ? and * in table.

    2.i am  trying to create a view using the following query

    "CREATE VIEW [view-name] WITH SCHEMABINDING AS (SELECT "table-name"."attribute"  FROM "table-name" WHERE (( ISNULL("table-name"."attribute", ' ')  =  '漢字漢字漢字漢字漢' )))"

    3.table in the view is not containing any value for the attribute(the select command does not return anything)

    4.whenever i use > symbol instead of = its return some value from the table (< and = operators does return any value in select command)

    can anyone please help me out .

    Monday, July 01, 2013 10:32 AM


  • You need to make the literal you are testing be 16 bit.  So  use N'漢字漢字漢字漢字漢', not  '漢字漢字漢字漢字漢'.

    Also, what is the datatype of  "table-name"."attribute"?  It also needs to be 16 bit characters, that is (for example) nvarchar, not varchar.


    Monday, July 01, 2013 12:34 PM

All replies