Use the N prefix so the string literal is interpreted as unicode not char under the code page of whatever your database's default collation is
Try this
SELECT [ID] ,[Caption] FROM [Dictionary] where Cast(Caption AS Nvarchar(max))like N'חי%'
سؤال
this is my sql query
SELECT [ID] ,[Caption] FROM [Dictionary] where Caption like 'חי%'
The information exists in my table, but is not displayed.
When i change the hebrew word (חי) to english word it works fine.
I have Microsoft sql 2008..(if it matters..) what am i missing here?
المحلول
Use the N prefix so the string literal is interpreted as unicode not char under the code page of whatever your database's default collation is
Try this
SELECT [ID] ,[Caption] FROM [Dictionary] where Cast(Caption AS Nvarchar(max))like N'חי%'