문제

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