CREATE procedure [C6StagingPeriodico].[REPTRIM_WANVIPS]  
AS 
BEGIN  
exec [C6StagingPeriodico].[RP_W6LogBatch] 'Replica WANVIPS'
TRUNCATE TABLE [C6StagingPeriodico].[WANVIPS]
INSERT INTO [C6StagingPeriodico].[WANVIPS]
           ([DTTRIM]
           ,[RETE]
           ,[CODFIS]
           ,[CODANA]
           ,[FLAG6KC]
           ,[CODMAN]
           ,[CODCONF]
           ,[FLGORIG]
           ,[FLGIMM])
SELECT [DTTRIM]
      ,[RETE]
      ,[CODFIS]
      ,[CODANA]
      ,[FLAG6KC]
      ,[CODMAN]
      ,[CODCONF]
      ,[FLGORIG]
      ,[FLGIMM]
  FROM FSEI0.FSEI0.[fsei0_pdc].[wanvips]
  exec [C6StagingPeriodico].[RP_W6LogBatch] 'Replica WANVIPS'
END