
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[p_grid_act_branches_departments]
	@branch_id int = -1,
	@department_code AS ais_code_short  = '%' 
AS
BEGIN
	SET NOCOUNT ON

	SELECT	*
	FROM	act_branches_departments
	WHERE	(
			@branch_id < 0 
			or 
			brdep_branch_id = @branch_id
			)
	and		
			(
			@department_code = '%' 
			OR 
			brdep_department_code = @department_code
			)
END




GO
