Question

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.

Était-ce utile?

La solution

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

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

Autres conseils

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top