Issue with Accented Character
Question
Hi,
We are having an issue with a raw query which has some accent data. We are using SAP B1 adapter execute query function for the same.
Ex: Update OCRD set U_PersonName= ‘Michał Paner’ where Cardcode = ‘C1234’
it updates person name as Michal Paner without any accent letter (ł is an accent letter in this example).
Can you please help us.
solved
0
Developer
10 months
1 Answer
277 views
Beginner 0
Answer ( 1 )
Hi Shankar,
Thank you for your question.
The SQL Queries always type cast the parameters as VarChar when you pass it in a clause. But as you know Varchar is only limited to ASCII characters, you need to compare using NVarchar strings in SQL Server.
Use this code below:
Update OCRD set CardName= N"jkl mno" where Cardcode = "ABCD"
The additional N prefixed before the CardName setter of OCRD will ensure the data is stored in NVarchar and never convert it to ASCII.