Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server Arabic question mark

Tags:

sql-server

I have Arabic data in the table but it is displayed as a question mark:

enter image description here

How I can resolve this problem?

like image 972
alaa kandah Avatar asked Mar 21 '26 05:03

alaa kandah


2 Answers

Change the type of clientname nvarchar and the collation to Arabic_100_CI_AI, then in the insert query you have to add N before inserting the value, like in this example:

insert into table_name (...,clientname,..) values (...,N'محمد علي',....);
like image 196
Amar Zaidi Avatar answered Mar 22 '26 19:03

Amar Zaidi


This is happening because the collation of your db doesn't support the language, whereas I think you're using varchar too. You have 2 possible solutions: The first one is to re-create your database with this encoding: SQL_LATIN1_General_CP1256_CI_AS (When creating db write your db name, and then go to options in the left sidebar then change the collation to the SQL Latin1 collation type". The second one is to change the column type from varchar(N) to nvarchar(N) I used the both scenarios and both worked for me.

like image 45
Laith Sa'd Al-Deen Avatar answered Mar 22 '26 18:03

Laith Sa'd Al-Deen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!