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

GO 

--SELECT * FROM V_PAINEL_NFE_EST_NF_ENT_DANFE_ERROS_IMPORTACAO_ANALITICO 
CREATE VIEW V_PAINEL_NFE_EST_NF_ENT_DANFE_ERROS_IMPORTACAO_ANALITICO  
AS
SELECT id AS codigoControle,
       CD_FILIAL AS filialOrigemId,
       DH_IMPORT AS data,
       ide_nnf AS numeroNfe,
       chave_nfe AS chaveNfe,
       emit_xnome AS emitente
FROM V_NFE_ERROS_IMPORTACAO
WHERE CD_FILIAL > 0
