应该没问题,可能是你的SERVER错了

解决方案 »

  1.   

    这就是所有代码了,我调试了,将update news set content=replace(convert(varchar(2000),content),'http://woaserver:8010/','/') where id=@id
        去掉,可以执行。
    我现在已经解决了。
      

  2.   

    select id,convert(varchar(4000),content) from news 
    open news_cur
    --fetch next from news_cur into @id,@title
    fetch next from news_cur into @id,@contentwhile @@fetch_status=0
    begin
         update news set content=replace(@content,'http://woaserver:8010/','/') where id=@id
         --update news set title=@title where id=@id
         --fetch next from news_cur into @id,@title
         fetch next from news_cur into @id,@content
    end deallocate news_cur这是更新后脚本代码
      

  3.   

    为了大家看得更清楚,两段代码分别如下:
    NO1、
    declare news_cur cursor
    for 
    select id from news 
    open news_cur
    fetch next from news_cur into @idwhile @@fetch_status=0
    begin
         update news set content=replace(convert(varchar(5000),content),'http://woaserver:8010/','/') where id=@id
         fetch next from news_cur into @id
    end deallocate news_curNO2、
    declare news_cur cursor
    for 
    --select id,title from news 
    select id,convert(varchar(4000),content) from news 
    open news_cur
    --fetch next from news_cur into @id,@title
    fetch next from news_cur into @id,@contentwhile @@fetch_status=0
    begin
         update news set content=replace(@content,'http://woaserver:8010/','/') where id=@id
         --update news set title=@title where id=@id
         --fetch next from news_cur into @id,@title
         fetch next from news_cur into @id,@content
    end deallocate news_cur说明:第一段代码在sql7.0上运行正常,在sql2000上报错
          第二段代码在sql2000上运行成功。
    能够找出确实原因的,同样给分。
      

  4.   

    你的news里面content字段长度是多少?