22,210
社区成员
发帖
与我相关
我的任务
分享
---try
exec sp_executesql N'update l_goodsbom set goodsposition=@P1,substitute=3268,
ecn=right(memo,len(memo)-charindex(''Ecn'',memo)+1) where goodsid=3934 and charindex(@p1,rtrim(ltrim(memo)))>0',
N'@P1 varchar(64)',
@P1='FOR C3 BTM'
declare @P2 nvarchar(1000)
set @P2='charindex(''FOR C3 BTM替代料'',rtrim(ltrim(memo)))<>0'
declare @s nvarchar(4000)
set @s=N'update l_goodsbom set goodsposition=@P1,substitute=3268,ecn=right(memo,len(memo)-charindex(''Ecn'',memo)+1) where goodsid=3934 and '+@P2
exec sp_executesql @s, N'@P1 varchar(64),@P2 varchar(64)', 'FOR C3 BTM'
exec sp_executesql N'
update l_goodsbom set
goodsposition=@P1,substitute=3268,ecn=right(memo,len(memo)-charindex(''Ecn'',memo)+1)
where goodsid=3934 and charindex(@P2,rtrim(ltrim(memo)))<>0
',
N'@P1 nvarchar(64),@P2 nvarchar(64)', '''FOR C3 BTM''', '''FOR C3 BTM替代料'''
exec sp_executesql N'
update l_goodsbom set
goodsposition=@P1,substitute=3268,ecn=right(memo,len(memo)-charindex(''Ecn'',memo)+1)
where goodsid=3934 and @P2
',
N'@P1 nvarchar(64),@P2 nvarchar(64)', '''FOR C3 BTM''', 'charindex(''FOR C3 BTM替代料'',rtrim(ltrim(memo)))<>0'
TRY
and @P2