|
 |
存储过程替换text,ntext列中的字符串 |
|
|
|
作者: 时间:2004-7-12 来自: 责任编辑: 阅读次数: | |
/* author:amjn date:2003-03-28 version:1.0 function:替换text,ntext列中的字符串(不支持中文) */ declare @ptr varbinary(16) declare @amjnId int declare @Position int,@len int set @len=datalength('ILOVEHJL') declare wux_Cursor scroll Cursor for select textptr([Name]),[amjnId] from USA201 for read only open wux_Cursor fetch next from wux_Cursor into @ptr,@amjnId while @@fetch_status=0 begin select @Position=patindex('%ILOVEHJL%',[Name]) from USA201 where [amjnId]=@amjnId while @Position>0 begin set @Position=@Position-1 updatetext USA201.[Name] @ptr @Position @len 'i love hjl' select @Position=patindex('%ILOVEHJL%',[Name]) from USA201 where [amjnId]=@amjnId end fetch next from wux_Cursor into @ptr,@amjnId end close wux_cursor deallocate wux_cursor go
|
|
|
|
中华网校依法保护知识产权,如果我们的文章有涉及或侵犯您的有关权益,请即时与我们
联系,
注明网址及文章,我们会即时处理或删除,感谢您的合作!中华网校email
中华网校由广州市中六电脑城智锐计算机专业培训学院及中华网校技术中心提供网络支持未经本站许可任何个人网站、书刊报社一律不得私自复制,转载本站内容! |
|
 | |
|