FITOMN of AM v3
6/28/2017 - 9:46 PM

CERTIFICADOS ACADEMICOS - sp2CES_ALU_VerificaConfigCertificado

CERTIFICADOS ACADEMICOS - sp2CES_ALU_VerificaConfigCertificado


----------------------------INICIO PROCEDIMIENTO ------------------------
IF OBJECT_ID('sp2CES_ALU_VerificaConfigCertificado', 'P') IS NOT NULL
      DROP PROC sp2CES_ALU_VerificaConfigCertificado 
GO

CREATE PROCEDURE [dbo].[sp2CES_ALU_VerificaConfigCertificado]
(
	@idFormatoCer INT
/* --------------------------------------------------------------------------------------------------------------
	FECHA	   |    AUTOR		|	DESCRIPCION
 28/jun./2017  | Luis Bernal	| 
--------------------------------------------------------------------------------------------------------------*/
)
AS
BEGIN
	SET NOCOUNT ON;

	SELECT DISTINCT cccd.iFolioClaveCer, 
					COUNT(cfci.iFolio) AS NumFoliosCreados
	FROM dbo.Ctrl_ConfigCertificados AS ccc
		 INNER JOIN dbo.Ctrl_ConfigCertificadosDet AS cccd ON cccd.idConfgTipoCer = ccc.idConfigTipoCer AND ccc.idFormatoCer = @idFormatoCer
		 LEFT JOIN dbo.Ctrl_FormatosCertificadosImpresos AS cfci ON cfci.iFolioClaveCer = cccd.iFolio
	GROUP BY cccd.iFolioClaveCer

END