zoukankan      html  css  js  c++  java
  • Replace ntext类型中的文字

    2007-09-17 18:37
    create table #temp (rowid int,textcol ntext
    insert into   #temp values (1,'aaa bbb ccc ddd eee'
    insert into   #temp values (2,'aaa bbb cc ddd eee'
    insert into   #temp values (3,'fff ggg ccc iii jjj'
    declare @from nvarchar(100), @to nvarchar(100), @pos int@len int@rowid int 
    declare @ptrval binary(16
    set @from='ccc' 
    set @to='hhh' 
    set @len = len(@from
    set @rowid = 0 
    select @rowid = rowid,@pos = charindex(@from,textcol)-1 from #temp where 
    charindex(@from,textcol) > 0 
    while (@rowid > 0
    begin 
    select @ptrval = textptr(textcol) from #temp where rowid = @rowid 
    updatetext #temp.textcol @ptrval @pos @len @to 
    set @rowid = 0 
    select @rowid = rowid,@pos = charindex(@from,textcol)-1 from #temp where 
    charindex(@from,textcol) > 0 
    end 
    select * from #temp 
    drop table #temp
  • 相关阅读:
    fastjson-alibaba
    ubuntu 入门
    资料文档
    asp.net mvc View视图相关
    视频
    js第三方
    工具类网址
    [转]初学者的编程自学指南
    seajs的使用--主要了解模块化
    其它
  • 原文地址:https://www.cnblogs.com/qingyun163/p/2365569.html
Copyright © 2011-2022 走看看