/*(
* STORED stp_ParticolariImballoByParticolare
*
* elenco distinct particolari/imballo da particoalre
*
* Steamware, S.E.L.
* mod: 2010.07.07
*
****************************************/
create PROCEDURE [dbo].[stp_ParticolariImballoByParticolare]
(
	@Particolare VARCHAR(50)
)
AS
	SELECT DISTINCT Particolare, DescParticolare, Esponente, Figura, CodImballo
	FROM	(
				SELECT       TOP (1) @Particolare AS Particolare, '' AS DescParticolare, '' AS Esponente, '' AS Figura, '*' AS CodImballo
				FROM         v_particolariEsponenteFigura
                WHERE        (Particolare = @Particolare)
			 UNION
				SELECT DISTINCT Particolare, '' AS DescParticolare, '' AS Esponente, '' AS Figura, CodImballo
	            FROM            v_particolariEsponenteFigura AS v_particolariEsponenteFigura_1
	            WHERE        (Particolare = @Particolare)
			) AS derivTab
	
RETURN
