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

	GO
		CREATE PROC NET_DEL_REGIONAL
	(
	  @pCodRegional INT = NULL
	, @pType VARCHAR(30) = NULL
	, @pStatus INT = NULL

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


	SET NOCOUNT OFF 
	END 

