/****** Object:  View [dbo].[V_PAINEL_NFE_EST_NF_ENT_DANFE_PROVISORIO_ERROS_VALIDACAO_QTDE]    Script Date: 17/11/2018 11:00:00 ******/ 
IF EXISTS (SELECT * 
           FROM   SYS.VIEWS 
           WHERE  OBJECT_ID = 
      Object_id(N'[dbo].[V_PAINEL_NFE_EST_NF_ENT_DANFE_PROVISORIO_ERROS_VALIDACAO_QTDE]')) 
  DROP VIEW [dbo].[V_PAINEL_NFE_EST_NF_ENT_DANFE_PROVISORIO_ERROS_VALIDACAO_QTDE] 

GO

--SELECT * FROM V_PAINEL_NFE_EST_NF_ENT_DANFE_PROVISORIO_ERROS_VALIDACAO_QTDE	WITH (NOLOCK)
CREATE VIEW [dbo].[V_PAINEL_NFE_EST_NF_ENT_DANFE_PROVISORIO_ERROS_VALIDACAO_QTDE] AS
SELECT COUNT(CD_CTR_ERROS) AS QTDE_ERROS_VALIDACAO
FROM EST_NF_ENT_DANFE_PROVISORIO_ERROS_VALIDACAO V WITH (NOLOCK)
INNER JOIN EST_NF_ENT_DANFE_PROVISORIO_PENDENTE P ON V.CD_CTR = P.CD_CTR