CREATE   procedure [C6StagingPeriodico].[REPTRIM_WSEIMM_POS_SQL]  
AS 
BEGIN  
exec [C6StagingPeriodico].[RP_W6LogBatch] 'Replica WSEIMM_POS_SQL'
truncate table [C6MartPeriodicoImmobiliare].[W6IMM]
INSERT INTO [C6MartPeriodicoImmobiliare].[W6IMM]
           ([RETE]
           ,[CODFIS]
           ,[CONTRATTO]
           ,[CONSULENZA]
           ,[SERVIZIO_AGGIUNTIVO]
           ,[STATO_ADD_IMMOBILIARE]
           ,[STATO_IMPORTAZIONE]
           ,[FLAG_IN_PERIMETRO]
           ,[RENDICONTO_SEI]
           ,[RENDICONTO_IMM])
SELECT  [RETE]
           ,[CODFIS]
           ,[CODCONF]
           ,[TIPCONS]
           ,[SERVAGG]
           ,[ADDIMM]
           ,[STAIMP]
           ,[FLAGPE]
           ,[RENDSEI]
           ,[RENDIMM]
  FROM  FSEI0.sfsei0.[fsei0_pdc].[w6imm]
  exec [C6StagingPeriodico].[RP_W6LogBatch] 'Replica WSEIMM_POS_SQL'
END