比如在A表B列里的 动静(Dong Jin)我想删除这列所有括号里的内容 删除后是 动静请问改怎么写呢?

解决方案 »

  1.   

    Declare @A Table (B Nvarchar(1000))
    Insert @A Select N'动静(Dong Jin)'
    Union All Select N'AA(AA)'Update @A Set B=Stuff(B,CharIndex('(',B),CharIndex(')',B)-CharIndex('(',B)+1,'')
    Select * From @A
    --Result
    /*
    B
    动静
    AA
    */
      

  2.   

    declare @t table(B varchar(20))
    insert @t select '动静(Dong Jin)' union all select 'AAA'update @t set B=replace(B,'(Dong Jin)','')select * from @t
      

  3.   

    我理解错误,应该用paoluo(一天到晚游泳的鱼) 的~
      

  4.   

    declare @s varchar(8000) , @n int , @n1 int
    set @s = '动静(Dong Jin)' 
    set @n = charindex('(' , @s , 1)
    set @n1 = charindex(')' , @s  , 1 )
    set @s = stuff(@s , @n , @n1 - @n +1 ,'' )
    print @S
      

  5.   

    update a set b='动静'
      

  6.   

    t122() ( ) 信誉:100  2006-07-01 10:49:00  得分: 0  
     
     
       update a set b='动静'
      
     
    --------------------
    把問題也想的太簡單了吧