sql语句是这样写的
update tbl_vote set v_show=not v_show where v_type=1
在ACCESS中没问题,转成SQL后报错:在关键字 'not' 附近有语法错误。

解决方案 »

  1.   

    update tbl_vote set v_show='not v_show' where v_type=1 
      

  2.   

    将 varchar 值 'not v_show' 转换为数据类型为 bit 的列时发生语法错误。
    不行啊
    (v_show在access中是布尔型,在SQL SERVER中是BIT型)
      

  3.   

    --根据楼主的意思try
    update tbl_vote 
    set v_show = 0
    where v_type=1 
    and v_show = 1update tbl_vote 
    set v_show = 1
    where v_type=1 
    and v_show = 0
      

  4.   

    update tbl_vote set v_show=0 where v_type=1 
      

  5.   

    update tbl_vote set v_show=1-sign(v_show) where v_type=1 
      

  6.   

    那样写有问题,最后结果v_type=1的v_show都变成了1
      

  7.   

    update tbl_vote 
    set v_show = case v_show when 1 then 0 else 1 end 
    where v_type=1 
      

  8.   

    update tbl_vote set v_show=(- v_show) where v_type=1