奇怪的是,我把if(charindex('c',@str)>0)
改成if(1>0)就很快,难道游标里无法使用函数?

解决方案 »

  1.   

    open cur
    fetch next from cur into @str
    while (@@fetch_status=0)
    begin
    if(charindex('c',@str)>0)
    begin
    print 'lastName is :'+@str
    fetch next from cur into @str
    end
    fetch next from cur into @str /---注意这一行
    end
      

  2.   

    To ronggu552(grh) 兄:
    open cur
    fetch next from cur into @str
    while (@@fetch_status=0)
    begin
    if(charindex('c',@str)>0)
    begin
    print 'lastName is :'+@str
    fetch next from cur into @str     /--注意这一行,俺写过了呀
    end
    fetch next from cur into @str /---注意这一行
    end