LZ:你Content应该不止含有 http://192.168.1.110/ 这个吧
如果你只想更新含有http://192.168.1.110/ 这个的话,Try[注意:下面语句只能更新<8000字符内的Content]Declare @T Table(id int,Content ntext)
Insert @T Select 1,'http://192.168.1.110/掌骨额http://192.168.1.110/阳升的地方http://192.168.1.110/永点http://192.168.1.110/ '
Union All Select 2,'李四http://192.168.1.110/张三http://192.168.1.110/阳升的地方'
--更新
Update @T Set Content=Replace(Cast(Content As Varchar(8000)),'http://192.168.1.110/','web')
--查询更新后的结果
Select * From @T---结果
/*
id          Content   
----------- ---------------------------------
1           web掌骨额web阳升的地方web永点web 
2           李四web张三web阳升的地方(所影响的行数为 2 行)
*/

解决方案 »

  1.   

    把类似http://192.168.1.110/都更新成web,如http://192.168.1.1、http://192.168.1.100等
    Try[注意:下面语句只能更新 <8000字符内的Content] Declare @T Table(id int,Content ntext)
    Insert @T Select 1,'http://192.168.1.110/掌骨额http://192.168.1.110/阳升的地方http://192.168.1.110/永点http://192.168.1.110/ '
    Union All Select 2,'李四http://192.168.1.1/张三http://192.168.1.100/阳升的地方' --注意这里有http://192.168.1.1/等地址---更新
    While Exists(Select 1 From @T Where CharIndex('http://',Content)>0)
    Update @T 
           Set Content=Stuff(Cast(Content As Varchar(8000)),CharIndex('http://',Content),CharIndex('/',Content,CharIndex('//',Content)+2)-CharIndex('http://',Content)+1,'web')
    Where CharIndex('http://',Content)>0--查询更新后的结果
    Select * From @T---结果
    /*
    id          Content                        
    ----------- -------------------------------
    1           web掌骨额web阳升的地方web永点web 
    2           李四web张三web阳升的地方(所影响的行数为 2 行)
    */
      

  2.   

    在sql2005下面不在建议使用TEXT\NTEXT\IMAGE数据类型,请使用NVARCHAR(MAX)代替
      

  3.   


    DECLARE @insert_offset int,@delete_length int
    DECLARE @newstr varchar(50)set @delete_length = len('http://192.168.1.110/')
    set @newstr = 'web'select @insert_offset = patindex('%http://192.168.1.110/%',str)-1 from a where id=1DECLARE @ptrval binary(16)
    SELECT @ptrval = TEXTPTR(str) FROM a where id=1
    UPDATETEXT a.str @ptrval @insert_offset @delete_length @newstr
    这个不限制字段长度的,但是只更新第一次出现的,可以自己修改一下
      

  4.   

    用bcp将数据导出,用word替换,再用bcp导入
      

  5.   

    谢谢大家,总出现中文问题,没有办法只好用.net作了一个小程序实现.不过还是非常感谢大家,马上结贴