select right('aaa^^hhh',len('aaa^^hhh')-charindex('^^','aaa^^hhh',1)-1)

解决方案 »

  1.   

    declare @s nvarchar(4000)
    set @s='aaaaaa^^hhhhhhh'
    select substring(@s,charindex('^^',@s)+2,len(@s))
      

  2.   

    select 左边=left(col,patindex(col,';')),右边= right(col,len(col)-patindex(col,';')) from tb1
    这里的';'为分隔符号
      

  3.   

    抱歉,搞错,更正
    select 左边=left(col,patindex('%;%',col)-1),右边= right(col,len(col)-patindex('%;%',col))from tb1
    这里的';'为分隔符号
      

  4.   

    select replace(replace('aa^^hhhh','a'),'^')
      

  5.   

    update:
    select replace(replace('aa^^hhhh','a',''),'^','')