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

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


RETURN @TotCelle
