MS SQL select-where unicode string-equality失败

时间:2022-12-12 22:59:42

I am running this query and it is not returning any record , but in actual the record is exists. My record is all full of Chinese character.

我正在运行此查询并且它没有返回任何记录,但实际上记录存在。我的记录充满了汉字。

My Query is

我的查询是

SELECT * FROM Users U WHERE NickUser = N'你好12345' AND Password = '1234567'

The NickUser is a NVARCHAR type and the NickUser 你好12345 is really in my table.

NickUser是NVARCHAR类型,NickUser你好12345真的在我的桌子里。

Is that any setting issue i left out ?? or there is problem with my query ?

这是我遗漏的任何设置问题吗?或者我的查询有问题?

1 个解决方案

#1


0  

Maybe there is invisible character in your database. Investigate that data using like operator, select values with its length to see, if visible characters count is the same as stored characters count.

也许你的数据库中有隐形字符。使用like运算符调查数据,选择值及其长度来查看,如果可见字符数与存储的字符数相同。

#1


0  

Maybe there is invisible character in your database. Investigate that data using like operator, select values with its length to see, if visible characters count is the same as stored characters count.

也许你的数据库中有隐形字符。使用like运算符调查数据,选择值及其长度来查看,如果可见字符数与存储的字符数相同。