请教高手,存储过程参数转换的问题。
存储过程,传入参数
@djbhstr=('ADH00000008,ADH00000009,ADH00000010')
如何将@djbhstr的值,转化为
('ADH00000008','ADH00000009','ADH00000010')
便于符合:
update jh_dhhz set outflag=1 where danjbh in ('ADH00000008','ADH00000009','ADH00000010')
------解决方案--------------------replace(@djbhstr,',',''',''')
------解决方案--------------------replace替换
------解决方案--------------------
上面掉了单引号
SQL code
declare @djbhstr varchar(1000)
set @djbhstr='ADH00000008,ADH00000009,ADH00000010'
select replace(''''+@djbhstr+'''',',',''',''')
/*
'ADH00000008','ADH00000009','ADH00000010'
*/