if len(strA)-len(replace(strA,";",""))=3 then
  处理过程
end if

解决方案 »

  1.   


    看错了,以为是VB版。不过,SQL Server也是用类似的方法,通过判断字串长度来处理。
      

  2.   

    if (len(rtrim(ltrim(@strA)))-len(rtrim(ltrim(replace(@strA,';','')))))=3 
      select  '三个分号'
    else
      select  'a'
      

  3.   

    declare @stra varchar(100)
    set @stra='ab;cd;ef;'
    if (len(rtrim(ltrim(@strA)))-len(rtrim(ltrim(replace(@strA,';','')))))=3 
      print  '三个分号' ---在这里写你的处理过程
    else
      print  '不是三个分号' -- 提示错误的代码