select ' ' + col from tb

解决方案 »

  1.   

    select ' ' + col from tb 
      

  2.   

    declare @tb table(col varchar(20))
    insert @tb
    select '32323' union all
    select 'sdaf2' select stuff(col,patindex('%[1-9]%', col),0,' ') from @tb
    /*
     32323
    sdaf 2
    */
      

  3.   

    DECLARE @t TABLE([v] NVARCHAR(6))
    INSERT @t SELECT N'123'
    UNION ALL SELECT N'ad132'
    UNION ALL SELECT N'asf'
    UNION ALL SELECT N'232ads'
    /************/
    /*Test  Data*/
    /***fcuandy**/
    /*2008-11-24*/
    /************/
     
    SELECT * FROM @t
    /*
    123
    ad132
    asf
    232ads
    */
    UPDATE @t SET v = STUFF(v,PATINDEX('%[0-9]%',v),1,' ') WHERE PATINDEX('%[0-9]%',v)>0
    SELECT * FROM @t
    /*
     23
    ad 32
    asf
     32ads
    */
      

  4.   


    declare @a varchar(50)
    set @a = 'abda1dfd'select stuff(@a,patindex('%[1-9]%', @a),0,space(1)) 结果:
    abda 1dfd
      

  5.   

    错了,像4楼那样, stuff(p1,x,0,' ')
    不是1.打忘了
      

  6.   

    select space(1) + name from table