	IF OBJECT_ID('NET_DEL_ETICKET') IS NOT NULL
		DROP PROC NET_DEL_ETICKET

	GO
		CREATE PROC NET_DEL_ETICKET
	(
	  @pCodEticket INT = NULL
	, @pType VARCHAR(30) = NULL
	, @pStatus INT = NULL

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


	SET NOCOUNT OFF 
	END 

