IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_gen_prd_base_proc]') AND type = 'P')
DROP PROCEDURE [dbo].[mps_gen_prd_base_proc]
GO
create procedure [dbo].[mps_gen_prd_base_proc](
@cmpid int,
@pcid int
)
as
begin
set nocount on
exec mps_gen_prdnew @cmpid , @pcid 
exec mps_gen_prdmodify @cmpid , @pcid 
exec mps_gen_prdmodify0 @cmpid , @pcid 
exec mps_gen_prdquery @cmpid , @pcid 
exec mps_gen_prdquery_simple @cmpid , @pcid 
declare @pctag int 
select top 1 @pctag = pc_tag from mps_prdctg where pc_id=@pcid 
exec mps_gen_prdquery_tag @cmpid , @pctag 
exec mps_gen_prdquery_simple_tag @cmpid , @pctag 
exec mps_gen_prdfull  @cmpid , @pcid 
set nocount off
end