把ACCESS数据导入MS-SQL中后,ACCESS中有个‘是/否’的数据类型,导入SQL后,数据类型为bit类型,和ACCESS中的语法就不一样拉,我应该怎么样做,才能解决这个问题!

解决方案 »

  1.   

    改查询:
    case 字段名 when 1 then '是' else '否' end
      

  2.   

    MSSQL里有个通用的数据格式,不妨试下
      

  3.   

    是/否’的数据类型导入SQL后 就应该是bit类型
    查询的时候可以用Case 转换一下
      

  4.   


    create table #(a bit)insert into #
    select '1' union all
    select '1' union all
    select '0' union all
    select '1' union all
    select '0' union all
    select '0' select * from #
    select case a when 0 then '否' else '是' end from #
      

  5.   

    select case 字段名 when 1 then '是' else '否' end

    select case when 字段名=1 then '是' else '否' end
      

  6.   

    有两个方法来实现:
    1.如楼上几位所言,保持数据不变,仅是在显示时加上判断
    select case 字段名 when 1 then '是' else '否' end
    2.新建一列(NEWCol),类型设为CHAR(2),然后执行更新操作
     Update 表名 Set NewCol==(case when sex=1 then '是' else '否' end)