declare @ID int
declare @strtmp varchar(max or 8000)
declare @strold char(old_length),@strnew char(new_length)
set @strold = 'oldChar'
set @strnew = 'newChar'
declare replace_Cursor scroll Cursor
for
select id from current_table
open replace_Cursor
fetch next from replace_Cursor into @ID
while @@fetch_status=0
begin
select @strtmp = [current_content] from current_table where id=@ID
select @strtmp = Replace(@strtmp,@strold,@strnew)
update current_table set [current_content] = @strtmp where id=@ID
fetch next from replace_Cursor into @ID
end
close replace_Cursor
deallocate replace_Cursor
go
sql text类型内容替换
最新推荐文章于 2021-01-26 14:32:21 发布