Skip to content
Advertisement

How to save unicode character in SQL database

I am trying to save ThinSpace (u2009) to the database using ADO.NET classes, but instead I am getting “?” symbol in db in place of ThinSpace. String that I save to db in UTF8 format.

Result in DB

enter image description here

Advertisement

Answer

I believe you’re trying to insert unicode into a VARCHAR column. The SQL below:

Returns:

enter image description here

We see that SQL Server Management Studio renders a ? for an unknown character in a VARCHAR column. You’ll need to convert your column to an NVARCHAR for the text to render as expected.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement