 IF EXISTS( SELECT 1 FROM SYS.VIEWS    WHERE NAME = 'V_RC_DEB_CLI_TENTACLE')
    BEGIN
        DROP VIEW V_RC_DEB_CLI_TENTACLE;
    END;
GO

/****** Object:  View [dbo].[V_RC_DEB_CLI_TENTACLE]    Script Date: 19/04/2018 18:33:23 ******/
SET ANSI_NULLS ON 
SET QUOTED_IDENTIFIER ON
GO
 
CREATE VIEW [dbo].[V_RC_DEB_CLI_TENTACLE]
AS
     SELECT CD_EMP,
            CD_CLI,
            cast(CAST(FAT_XML AS varchar(max)) as varbinary(max)) AS FAT_XML, 
            GETDATE() AS DT_HR_CARGA
     FROM RC_DEB_CLI_PDV
     WHERE CD_EMP = 1;

GO
