Special Character in SQL

后端 未结 5 916
礼貌的吻别
礼貌的吻别 2020-12-07 01:57

I have a problem with a special character inserted in a table of SQL Server 2008 R2. The point is that when i\'m trying to insert a string with the character º (e.g. 3 ELBO

5条回答
  •  失恋的感觉
    2020-12-07 02:23

    The degree symbol

    U+00B0 ° degree sign (HTML: ° °)
    

    is not an ASCII character and generally requires an NVARCHAR column and a N'' string literal. (except for codepages etc that support the symbol)

    63 is the code of the question mark, which is the fallback for your inverse question mark in ASCII:

    select UNICODE('�') => 63
    select UNICODE(N'�') => 65533
    

    where 65533 is the Unicode Replacement Character used to display characters that could not be converted or displayed.

提交回复
热议问题