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

	GO
		CREATE PROC NET_DEL_PARTICIPANTE
	(
	  @pCodParticipante INT = NULL
	, @pType VARCHAR(30) = NULL
	, @pStatus INT = NULL

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


	SET NOCOUNT OFF 
	END 

