Click here to Skip to main content
15,888,313 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
hi all
i have stored which one of its parameter is in Arabic, i have a problem in entering this parameter like below
SQL
@Grade nvarchar(50)
as

begin
declare @s  nvarchar(50) 
set @s= N "'+@Grade+'" 
print @s


the result is '@Grade', So how could i input it in the correct format
Posted
Updated 18-Sep-19 23:17pm
Comments
Sergey Alexandrovich Kryukov 26-Jan-14 18:35pm    
There is no such thing as "Arabic variable", or "English variable"... :-)
—SA
mona shalaby 26-Jan-14 19:44pm    
the variable Grade is the variable which i enter in arabic

As per i understand from your question you want to save Arabic values in a variable.
for that try this:
1. You can use Arabic collations
SQL
CREATE TABLE #testArabic
(
  column1 nVARCHAR(100) COLLATE Arabic_CI_AI_KS_WS
)


OR

For the field to be able to store unicode characters, you have to use the type nvarchar or ntextor nchar.
To insert the unicode characters in the database you have to send the text as unicode by using a parameter type like nvarchar / SqlDbType.NVarChar from your coding side.
 
Share this answer
 
Try:
SQL
@Grade nvarchar(50)
as

begin
declare @s  nvarchar(50)
set @s= N'' + @Grade
print @s


For further information, please see:
Collation and Unicode Support[^]
Set or Change the Database Collation[^]
COLLATE (Transact-SQL)[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900