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:
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:
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
Update:
Try to use SqlDbType.NVarChar
when you pass your Parameter
.
and you can also try with :
INSERT INTO tests (ID_Number) VALUES (@name)
Use unicode datatypes for your data storage and begin your strings with N literal like this:
declare @t table(col Nvarchar(100));
insert @t (col) values (N'your text');
Or use the appropriate COLLATION with non-unicode data types but pass your values as unicode ones (with N) because your server/database collation seems to be different from arabic