/*
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][email protected]
while @position>0
begin
set @[email protected]
updatetext usa201.[name] @ptr @position @len 'i love hjl'
select @position=patindex('%ilovehjl%',[name]) from usa201 where [amjnid][email protected]
end
fetch next from wux_cursor into @ptr,@amjnid
end
close wux_cursor
deallocate wux_cursor
go
新闻热点
疑难解答