
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[p_grid_pr_products_documents]
	@product_code AS ais_code_short = '%'
AS
BEGIN
	
	SELECT	prd_l1, prd_l2, prd_l3, ppd.*, pa.pact_l1, pa.pact_l2, pa.pact_l3
	FROM	dbo.pr_products
		inner join pr_products_documents ppd on prd_product_code = prdd_product_code
		inner join pol_acts pa on ppd.prdd_act_code = pa.pact_act_code
	WHERE	(@product_code = '%' OR prd_product_code = @product_code)

END

GO
