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

	GO
		CREATE PROC NET_SEL_REGIONAL
	(
			  @pCodRegional INT = NULL
			,@pRegional VARCHAR(255) =  NULL 
			,@pStatus INT = NULL
			  ,@pOrder VARCHAR(50) =  NULL 
	)
	AS 
		
		BEGIN
			SET NOCOUNT ON
			
					SELECT
								CodRegional 
								,Regional
								,Status
								,CodUsuario
								,DataCadastro
		FROM 
						NET_REGIONAL
WHERE     
					((CodRegional = @pCodRegional) Or (@pCodRegional IS NULL OR @pCodRegional  = 0))
			And  ((regional  Like  @pRegional + '%' ) Or (@pRegional IS NULL OR @pRegional  = ''))
			And ((Status = @pStatus) Or (@pStatus IS NULL OR @pStatus  = 3))
			

	SET NOCOUNT OFF 
	END 

