UPDATE WX_Reports_Design SET reportConfig =REPLACE(reportConfig,'dbConnect','WiXinDB')
SELECT charindex(reportConfig,'dbConnect' ) FROM WX_Reports_Design
--定义替换的字符串
declare @s_str varchar(8000),@d_str varchar(8000)
select @s_str='DMM/'
--要替换的字符串
,@d_str='Studio/'
--替换成的字符串
--字符串替换处理
declare @p varbinary(16),@postion int,@rplen int
select @p=textptr(reportConfig),@rplen=len(@s_str),@postion=charindex(@s_str,CAST(reportConfig AS NVARCHAR(MAX)))-1 from WX_Reports_Design
WHERE ID=1
print @p
print @rplen
print @postion
while @postion>0
begin
updatetext WX_Reports_Design.reportConfig @p @postion @rplen @d_str
select @postion=charindex(@s_str,reportConfig)-1 from WX_Reports_Design
end
--显示结果
select * from WX_Reports_Design