Issue with Accented Character



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
Shankar 3 years 1 Answer 1469 views Beginner 0

Answer ( 1 )

  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.

    Best answer

Leave an answer

Sorry, you do not have a permission to answer to this question .