尝试更新多行会引发512错误

时间:2018-12-18 10:45:34

标签: sql-server sql-server-2008

有人可以为下面的代码提供替代解决方案吗?尝试更新多个记录时收到512错误。

update ActiveParty
set rmname = (select  CONCAT(rmname,rmadr1)
                from ActiveParty
                 where RMADR1 like ('%C/O%') or RMADR1 like ('%Attention%') or 
                 RMADR1 LIKE '%!%%' escape '!')
where RMADR1 in (select  RMADR1
                    from ActiveParty
                        where RMADR1 like ('%C/O%') or RMADR1 like 
                   ('%Attention%') or RMADR1 LIKE '%!%%' escape '!');

1 个答案:

答案 0 :(得分:1)

您可以更简单地将其重写为:

update ActiveParty
set rmname = CONCAT(rmname,rmadr1)
where RMADR1 like ('%C/O%') 
    or RMADR1 like ('%Attention%') 
    or RMADR1 LIKE '%!%%' escape '!'