CREATE procedure [C6StagingPeriodico].[REPTRIM_W6APAG]  
AS 
BEGIN  
exec [C6StagingPeriodico].[RP_W6LogBatch] 'Replica W6APAG'
TRUNCATE TABLE [C6StagingPeriodico].[W6APAG]
INSERT INTO [C6StagingPeriodico].[W6APAG]
           ([DTTRIM]
           ,[RETE]
           ,[CODFIS]
           ,[CODMAN]
           ,[APPORTI]
           ,[PRELIEVI])
SELECT [DTTRIM]
      ,[RETE]
      ,[CODFIS]
      ,[CODMAN]
      ,[APPORTI]
      ,[PRELIEVI]
  FROM FSEI0.sfsei0.[fsei0_pdc].[w6apag]
  exec [C6StagingPeriodico].[RP_W6LogBatch] 'Replica W6APAG'
END