USE DAGAZ	
	IF OBJECT_ID('NET_DEL_PARTVOO') IS NOT NULL
		DROP PROC NET_DEL_PARTVOO

	GO
		CREATE PROC NET_DEL_PARTVOO
	(
	  @pCodParticipanteVoo INT = NULL
	, @pType VARCHAR(30) = NULL
	, @pStatus INT = NULL

	)
	AS 
		
		BEGIN
			SET NOCOUNT ON
	
IF @pType = 'DELETE'		
				DELETE FROM 
										NET_PARTICIPANTE_VOO
							WHERE     
										((CodParticipanteVoo  = @pCodParticipanteVoo) );
ELSE
				UPDATE 
										NET_PARTICIPANTE_VOO
						SET
													Status =CASE WHEN  Status  = 1 THEN 0 ELSE 1 END
							WHERE     
										((CodParticipanteVoo   = @pCodParticipanteVoo) );


	SET NOCOUNT OFF 
	END 

