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

	SET @TotCelle = (SELECT		SUM(NumX * NumY * NumZ) AS Totale
	FROM		Blocchi
	WHERE		(CodCS = @CodCS) AND (CodMag = @CodMag))


RETURN @TotCelle
