Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Insert arabic words in sql server

Tags:

sql

sql-server

I have a problem when I try to insert arabic text as sql variable in sql server 2008 , inserts data like this value ???? .How to solve this?

This is my query

insert into tests values(N''+@name)

The result shows like this:

screenshot

like image 711
achu Avatar asked Sep 19 '26 20:09

achu


1 Answers

Try this and you will see what Data Type you shoule use :

DECLARE @V1 VARCHAR(50) = 'فيلم';
DECLARE @V2 NVARCHAR(50) = N'فيلم'

SELECT @V1 Varchar_Col, @V2 NVarchar_Col

Demo

Update:

Try to use SqlDbType.NVarChar when you pass your Parameter.

and you can also try with :

INSERT INTO tests (ID_Number) VALUES (@name)
like image 110
Ilyes Avatar answered Sep 22 '26 11:09

Ilyes



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!