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