%在存储过程的解决办法

create   proc   pipei
as
begin

declare   @string   varchar(1000)
declare   @keyword   varchar(30)

declare   cursor1   cursor   for   select   keyword   from   bb

open   cursor1
fetch   cursor1   into   @keyword
while(@@fetch_status   =   0)
begin

set   @string   =   'update   aa   set   mark   =   1   where   domain   like   ''%'+@keyword+''''

exec(@string)
fetch   cursor1   into   @keyword
end

close   cursor1
deallocate   cursor1
end
原文地址:https://www.cnblogs.com/hqbird/p/1316385.html