IF EXISTS
(
    SELECT 1
    FROM SYS.VIEWS
    WHERE NAME = 'V_EST_PROD_TBL_FIDEL_TENTACLE'
)
    BEGIN
        DROP VIEW V_EST_PROD_TBL_FIDEL_TENTACLE;
    END;
GO
CREATE VIEW V_EST_PROD_TBL_FIDEL_TENTACLE
AS
     SELECT CD_EMP,
            CD_TBL_FIDEL,
            DS_TBL_FIDEL,
            CD_INTEGRADORA,
           0 AS CD_PROMOCAO_INT,
            CONVERT (DATE,DT_INI)as DT_INI,
            CONVERT (DATE,DT_FIM)as DT_FIM,
            CD_USU,
            CONVERT (DATE,DT_CAD)as DT_CAD,
            CONVERT (DATE,DT_ULT_ALT)as DT_ULT_ALT,
            CD_TBL_FIDEL_PONTO_ADICIONAL
     FROM EST_PROD_TBL_FIDEL;