|
The cause of the problem is:
My website system has such a function:
To query user information by querying the user account.
When the user name is English, there is no problem, but when the user name is Chinese, no information can be found.
So I did some work and found some problems.
(1) I checked the pull stored procedure and verified it directly with the Chinese name in the database. No problem.
The executed statement is as follows
. . . . .
exec process name, @username process parameter = N'user name '-N stands for unicode encoding
. . . . .
(2) So I opened sql server profiler to monitor. Then I visited the webpage and found the calling statement shown below:
. . . . .
exec procedure name, @username procedure parameter = '? ? ? '-The difference from the above is that one N is missing, resulting in garbled characters.
. . . . .
(3) The key to solving the problem now is how to enable the database to execute the statement in (1) when the query comes directly from the website. |
|