SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[p_grid_variables_by_family]
	@family_code AS ais_code_short,
	@variable_code AS ais_code_short  = '%' 
AS
BEGIN
	SET NOCOUNT ON

	SELECT	*
	FROM	pr_families_variables pfv
			inner join nm_products_variables v on v.nmpv_variable_code = pfv.pfv_variable_code
	WHERE	pfv.pfv_family_code = @family_code
	AND		(
			@variable_code = '%' OR v.nmpv_variable_code = @variable_code
			)
END
GO
