3

I need to update a few site names that contain circumflex accents.

 update site
 set SITE_NAME = 'Gŵyr'
 from site
 where SITE_ID = '2112685'

However, the site name gets updated as Gwyr, without the accent. The column data type is nvarchar(256). I know that ^ is a UNICODE character, so is there an easy fix to put this character in the update query so it gets changed accordingly in the SITE_NAME column.

1 Answer 1

7

Add N before string literal to indicate that it is unicode:

Prefix Unicode character string constants with the letter N. Without the N prefix, the string is converted to the default code page of the database. This default code page may not recognize certain characters.

update site
set SITE_NAME = N'Gŵyr'
where SITE_ID = '2112685';

LiveDemo

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.