table名称:Test。字段只有一个Name nvarchar(64)。
现在写入一个字符串“甲状腺肿大Ⅰ°,两侧甲状腺结节”到Name字段中,查询后输出:“甲状腺肿大Ⅰ°,两侧甲状腺结节”。
若我单独写入Ⅰ后边的'°',则输出为单字符的。查询后与原来的不相等,请问这是为什们?请高手指点一下

解决方案 »

  1.   

    插入时用insert into test values(N'甲状腺肿大Ⅰ°,两侧甲状腺结节')
      

  2.   

    create table t(name nvarchar(64))insert into t select N'甲状腺肿大Ⅰ°,两侧甲状腺结节'
    insert into t select N'°'
    insert into t select '°'
    drop table t没问题啊
      

  3.   

    create table test(Name nvarchar(64))
    insert into test values(N'甲状腺肿大Ⅰ°,两侧甲状腺结节')
    goselect * from test where charindex( N'°',name) > 0drop table test/*
    Name                                                             
    ---------------------------------------------------------------- 
    甲状腺肿大Ⅰ°,两侧甲状腺结节(所影响的行数为 1 行)
    */
      

  4.   

    declare @t table(col nvarchar(30))
    insert @t values(N'甲状腺肿大Ⅰ°,两侧甲状腺结节')
    select * from @t where col like '%°%'col
    ------------------------------
    甲状腺肿大Ⅰ°,两侧甲状腺结节(1 行受影响)
      

  5.   

    create table  test(Name nvarchar(64))
    insert test select N'甲状腺肿大Ⅰ°,两侧甲状腺结节'
    insert test select N'°'
    select * from test
    /*
    Name                                                             
    ---------------------------------------------------------------- 
    甲状腺肿大Ⅰ°,两侧甲状腺结节
    °
    */
    drop table test
      

  6.   

    create table  test(Name nvarchar(64))
    insert test select N'甲状腺肿大Ⅰ°,两侧甲状腺结节'
    insert test select N'°'
    insert test select '°'
    select * from test
    /*
    Name                                                             
    ---------------------------------------------------------------- 
    甲状腺肿大Ⅰ°,两侧甲状腺结节
    °
    °
    */
    drop table test
      

  7.   


    create table test11(Name nvarchar(64))
    go
    insert into test11 select '°'
    union all select '甲状腺肿大Ⅰ°,两侧甲状腺结节'
    go
    select * from test11
    Name
      
    Name
    甲状腺肿大Ⅰ°,两侧甲状腺结节
    Name
    °