IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_gen_biznewdetail_after_all]') AND type = 'P')
DROP PROCEDURE [dbo].[mps_gen_biznewdetail_after_all]
GO
create procedure [dbo].[mps_gen_biznewdetail_after_all](
@cmpid int,
@bizid int
)
as
begin
declare @ord2tag int 
declare c1 cursor LOCAL FORWARD_ONLY READ_ONLY for
select distinct  biz2_tag  from mps_biztype2  where   biz2_bizid=@bizid   
open c1
FETCH NEXT FROM c1 INTO @ord2tag 
WHILE (@@FETCH_STATUS = 0)
BEGIN
exec mps_gen_biznewdetail_after @cmpid ,@bizid ,@ord2tag 
 FETCH NEXT FROM c1 INTO @ord2tag 
END
CLOSE c1
DEALLOCATE c1
end