当前位置: 代码迷 >> SQL >> 平添一条横杠到某字段里 sql
  详细解决方案

平添一条横杠到某字段里 sql

热度:99   发布时间:2016-05-05 13:10:30.0
添加一条横杠到某字段里 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 [email protected]


set @str = REPLACE(@str, '無限累計達到USD???? ', '無限累計達到USD_____')?

update exam
set [email protected]
?where examtype='1' and [email protected]

set @i = @i + 1

end

  相关解决方案