刚看到这样一段代码
,他们的执行结果,都有汉字,为什么我的,des字段是?号,USE test
IF OBJECT_ID('paylog','U') IS NOT NULL
    DROP TABLE paylogcreate table paylog (
           gold int not null,
           paydate datetime not null,
           des  varchar(10) not null
             )
insert into paylog
select '80','2010-09-10 13:18','付费'
union all
select '100','2010-09-11 14:18','赠送'
union all
select '30','2010-09-12 14:20','赠送'
union all
select '40','2010-09-13 14:20','付费'
union all
select '90','2010-09-14 14:20','付费'
union all
select '30','2010-09-15 14:20','赠送'go

解决方案 »

  1.   

    最好用nvarchar,以后就没有麻烦了。
      

  2.   

    可以,不过建议用nvarchar(20)插入,查询,更新前加N例如:insert into tb(col) values(N'汉字')
      

  3.   

    #1. 存储UNICODE字符,一定要用NVARCAHR
    #2. 插入字符时需要加N, 例如: N'测试'
      

  4.   

    http://topic.csdn.net/u/20100720/14/3ad225ec-f731-43c8-9730-149e82bd9186.html
      

  5.   

    我是想问下,大家用varchar存储汉字的时候能正常显示吗,一下代码执行后 用 ‘select * from paylog ’能看到汉字吗IF OBJECT_ID('paylog','U') IS NOT NULL
        DROP TABLE paylogcreate table paylog (
               gold int not null,
               paydate datetime not null,
               des  varchar(10) not null
                 )
    insert into paylog
    select '80','2010-09-10 13:18','付费'
    union all
    select '100','2010-09-11 14:18','赠送'
    union all
    select '30','2010-09-12 14:20','赠送'
    union all
    select '40','2010-09-13 14:20','付费'
    union all
    select '90','2010-09-14 14:20','付费'
    union all
    select '30','2010-09-15 14:20','赠送'
      

  6.   

    可以,只要数据库建立时默认排序时Chinese_CI_**就可以。不过有可能出现乱码。可以换成NVARCHAR对应。