| |

VerySource

 Forgot password?
 Register
Search
View: 1070|Reply: 7

If the query condition of sql server contains Chinese, the record cannot be found, what's the matter?

[Copy link]

1

Threads

3

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-10-19 11:00:02
| Show all posts |Read mode
In sql server.
Execute select * from Book where BookName like'%C language%', no record
There are definitely records in the table, but I can't find it, remove the Chinese,
Change to select * from Book where BookName like'%C%' to find,
It feels strange, execute select'test' in the query analyzer, and two question marks are displayed
What's going on? How to solve it?
Reply

Use magic Report

0

Threads

114

Posts

69.00

Credits

Newbie

Rank: 1

Credits
69.00

 China

Post time: 2020-10-19 11:15:01
| Show all posts
try:
select * from Book where charindex('C language',bookname)>0
Reply

Use magic Report

0

Threads

48

Posts

30.00

Credits

Newbie

Rank: 1

Credits
30.00

 China

Post time: 2020-10-19 16:15:01
| Show all posts
gb2312
unicode
Reply

Use magic Report

0

Threads

88

Posts

55.00

Credits

Newbie

Rank: 1

Credits
55.00

 China

Post time: 2020-10-19 16:30:01
| Show all posts
Is your system font Chinese?
What is the database character set?
Reply

Use magic Report

1

Threads

3

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-10-19 16:45:01
| Show all posts
Open the table directly in the database to display Chinese, insert and update Chinese can be used, just select
Reply

Use magic Report

1

Threads

8

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 Korea, Republic of

Post time: 2020-10-19 17:00:01
| Show all posts
select * from Book where BookName like N'%C language%'
Reply

Use magic Report

1

Threads

3

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-10-19 17:15:01
| Show all posts
Thanks, it's okay, but I still don't know what's going on
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 Invalid IP Address

Post time: 2020-10-19 22:15:01
| Show all posts
What to do without adding N?
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list