%在存储过程的解决办法

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
posted @ 2008-10-22 01:37  Jason.Bird  阅读(218)  评论(0编辑  收藏  举报