添加一条横杠到某字段里 sql
?
//--该存储过程的功能是:添加一条横杠到某字段里 例如: ?'無限累計達到USD'===>?'無限累計達到USD_____'?
?
?重点:使用到了Replace函数
?
declare @i int,@ExamID int, @str varchar(50)
set @i = 243
while @i<=255
begin
select? @ExamID=ExamID,@str=Question from exam where examtype='1' and Question like '%無限累計達到%' and ExamID=@i
set @str = REPLACE(@str, '無限累計達到USD???? ', '無限累計達到USD_____')?
update exam
set Question=@str
?where examtype='1' and ExamID=@ExamID
set @i = @i + 1
end