
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[p_grid_pr_products_variables]
    @product_code ais_code_short,
    @variable_code ais_code_short = '%'
AS 

select	*
from	vw_pr_products_variables_last_sit
	inner join nm_products_variables on prdv_variable_code = nmpv_variable_code
	inner join nm_products_variables_types on nmpv_type_code = nmpvt_type_code
where	prdv_product_code = @product_code
		and ( @variable_code = '%' or prdv_variable_code = @variable_code)


GO
