IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'SPGT_CREAVISTEAZIENDA') AND type in (N'P', N'PC'))
	DROP PROCEDURE SPGT_CREAVISTEAZIENDA
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE SPGT_CREAVISTEAZIENDA
	( 
		@CodiceAzienda as decimal(5,0) = 0
	)
AS
BEGIN

	EXEC SPGT_CREATEVIEWSTATODOC @CodiceAzienda 

	EXEC SPGT_CREATEVIEWSVARIANTI @CodiceAzienda 

END