欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

sql 替换text字段

程序员文章站 2022-05-08 17:57:09
...
declare grade_cur Cursor FOR select topicID,convert(varchar(4000),content) as content  from ejf_topic where   content like '%202.97.214.165:8080%'
 declare @detail nvarchar(3000)
 declare @topicID int
OPEN grade_cur
Fetch next from grade_cur into @topicID, @detail
while @@FETCH_STATUS = 0  
begin  

set @detail=REPLACE(@detail,'202.97.214.165:8080/bbs1','bbs.sale3g.com')
print @detail
update ejf_topic   set  content   [email protected]  where [email protected]


print @detail

fetch next from grade_cur into @topicID,  @detail
 

end

CLOSE grade_cur
DEALLOCATE grade_cur


 

相关标签: SQL BBS