I have bulk-data in SQL-Server table. One of the fields contains following data :

'(اے انسان!) کیا تو نہیں جانتا)' 

Tried:

SELECT * from Ayyat where Data like '%انسان%' ;

but it is showing no-result.

有帮助吗?

解决方案

Plese use N before string if language is not a english:

  SELECT * from Ayyat where Data like N'%انسان%' ;

其他提示

If you're storing urdu, arabic or other language except english in your database first you should convert your database into another format and then also table.

first you've to convert your database charset and also collation alter your database

ALTER DATABASE database_name CHARACTER SET utf8 COLLATE utf8_general_ci

then convert your table

ALTER TABLE table_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci

after this execute normal your query

SELECT * FROM table_name WHERE Datas LIKE '%انسان%'

Note: if you not convert your database and table other languages and special characters will be changed into question marks.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top