IF EXISTS
(
    SELECT *
    FROM sys.views
    WHERE object_id = OBJECT_ID(N'[dbo].V_EST_NF_NFE_LICENCAS_PDV_TENTACLE')
)
    DROP VIEW [dbo].[V_EST_NF_NFE_LICENCAS_PDV_TENTACLE];
GO
CREATE VIEW [dbo].[V_EST_NF_NFE_LICENCAS_PDV_TENTACLE]  
AS  
  SELECT  
  CD_FILIAL,  
  CNPJ,  
  UF,  
  ISNULL(CHAVE,'') AS CHAVE,  
  ISNULL(LICENCA,'') AS LICENCA ,  
  ISNULL(EMPRESA,'') AS EMPRESA,  
  ARQ_CERTIFICADO,  
  ISNULL(CSC_TOKEN,'') AS CSC_TOKEN,  
  ISNULL(ID_TOKEN,'') AS ID_TOKEN,  
  ISNULL(SERIE,'') AS SERIE,  
  ISNULL(PIN_CERT,'') AS PIN_CERT ,
  ISNULL(PINTOKEN,'') AS PINTOKEN   
  FROM EST_NF_NFE_LICENCAS
  WHERE 1=0
GO