好像只有回车没有空格,我怎么把他变成null呢

解决方案 »

  1.   

    给你个例子,看了就知道了:declare @t table(c1 int,c2 varchar(100))insert @t select 1,'a'
    union all select 2,char(10)
    union all select 3,char(13)
    union all select 4,'b'
    select * from @t
    update @t
    set c2 = null
    where charindex(char(10),c2) > 0
    or  charindex(char(13),c2) > 0select * from @t
      

  2.   

    select a,len(b) from table的结果是什么?
      

  3.   

    Trim  Replace都用过了,都不行
      

  4.   

    程序里没有什么,只是把它赋给了一个TextBox,然后又从这个TextBox上取了回来
      

  5.   

    有些的len是0而有些是1,我也不知道怎么回事,我这样写了
    (case len(standard)
           when 0 then ''
           when 1 then ''
           else standard 
       end) as standard
    谢谢大家了