/***************************************
* STORED stp_ContaCelleCapa
*
* effettua conteggio CAPACITA' TOTALE celle dai tipi assegnati dato codice magazzino
*
* Steamware, S.E.L.
* mod: 2010.07.22
*
****************************************/
create PROCEDURE [dbo].[stp_ContaCelleCapa]
(
	@CodCS VARCHAR(2),
	@CodMag VARCHAR(50), 
	@TotCelle INT OUTPUT
)
AS

	SET @TotCelle = (SELECT		SUM(Quantita * Capienza) AS Totale
	FROM		TipoCella
	WHERE		(CodCS = @CodCS) AND (CodMag = @CodMag))


RETURN @TotCelle
