sql server 2005 coding errors

Answered sql server 2005 coding errors

  • Thursday, May 10, 2012 9:21 AM
     
     

    I have a Special symbol "®", I can't Save it in database.

    In database "®" is show "?".

    Thanks.

    • Moved by Sheng Jiang 蒋晟MVP Thursday, May 10, 2012 8:01 PM English (From:一般性问题讨论区)
    •  

All Replies

  • Thursday, May 10, 2012 8:13 PM
     
     

    I think you need nvarchar datatype

    I have tried the following and it is work.

    create table #test
    (
    name nvarchar(10)
    )

    insert into #test values ('®')
    select * from #test

  • Thursday, May 10, 2012 8:16 PM
    Moderator
     
     Answered Has Code

    This is correct with the minor correction (although your code works as is) - you need to add N' prefix to indicate you're using unicode, e.g.

    DECLARE @test TABLE (NAME NVARCHAR(10))
    
    INSERT INTO @test
    VALUES (N'�')
    
    SELECT *
    FROM @test


    For every expert, there is an equal and opposite expert. - Becker's Law


    My blog