动网论坛,站长建站首选,国内使用量最多的论坛软件 动网论坛官方技术讨论区 站长工具 申请属于您自己的免费论坛
首页 | 新闻资讯 | 网站运营 | 网络编程 | 数据库 | 服务器 | 网页设计 | 图像媒体 | 网络应用 | 搜索优化 | 资源下载 | 动网主机 | DVBOX
    本站内  互联网 ASP论坛  ASP.Net论坛  PHP论坛
   数据库 → 阅读文章

 存储过程替换text,ntext列中的字符串

作者:amjn 来源:开发者俱乐部 
阅读 5111 人次 , 2003-8-20 10:23:00 

/* 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  
 本文Tags存储过程  
 收藏本文  打印本文  论坛讨论  关闭窗口
· 上一篇:MD5算法的T-SQL实现(FOR SQL2000)(一)
· 下一篇:关于SQL Server中几个未公布的访问注册表的扩展存储过程
· 分析Oracle数据库日志文件(2)
· SQL Server数据库技术(123)
· 让你的SQL运行速度明显提高
· 将Access数据库移植到Microsoft SQL Server 7.0
· 长期使用中型Access数据库的一点经验


关于本站 | 联系我们 | 业务合作 | 客户案例 | 诚聘英才 | 广告合作 | 收藏本站
海口动网先锋网络科技有限公司版权所有
Copyright © 2000 - 2006 Cndw.Com
中华人民共和国电信与信息服务业务经营许可证编号 琼 ICP 020077