惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
人人都是产品经理
人人都是产品经理
爱范儿
爱范儿
aimingoo的专栏
aimingoo的专栏
博客园 - 叶小钗
H
Help Net Security
Microsoft Security Blog
Microsoft Security Blog
The Cloudflare Blog
S
SegmentFault 最新的问题
小众软件
小众软件
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
量子位
H
Hackread – Cybersecurity News, Data Breaches, AI and More
V
V2EX
Martin Fowler
Martin Fowler
博客园 - 【当耐特】
J
Java Code Geeks
D
DataBreaches.Net
云风的 BLOG
云风的 BLOG
F
Fortinet All Blogs
Blog — PlanetScale
Blog — PlanetScale
Last Week in AI
Last Week in AI

博客园 - 风中灵药

如何在mvc中共用一个dbconext以节省资源提高性能? asp.net core api路由及多语言切换的实现 mp3转speex的一些研究(貌似不能播放,暂存着) 安装win7 64位和win10 64位双系统小结 macbook装双系统多分区其实很简单,你只要把macbook当作一台普通pc就可以了! 个人对AutoResetEvent和ManualResetEvent的理解 关于WPF下ComBox的SelectionChanged事件 一条语句实现查询各类别前10条记录 【原】Sql2005 实现递归 【转】javascript操作cookies 以及 正确使用cookies的属性 回归: css, bug bug, background-repeat and frames 如何用oledb读取dbf(FoxPro表)文件? SQL注入中利用XP_cmdshell提权的用法(转) Sql 2005自动备份并自动删除3天前的备份 ActiveX开发心得(原创) 常用正则表达式(包括中文匹配) 使用ASP.NET Global.asax 文件(转) 如何不打开文件 直接出现下载保存提示框 关于IFRAME 自适应高度的研究[转]
Replace ntext类型中的文字
风中灵药 · 2012-02-23 · via 博客园 - 风中灵药

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