CREATE procedure [C6StagingPeriodico].[REPTRIM_QD_VAR_RISK_WEEK2]  
AS 
BEGIN  
exec [C6StagingPeriodico].[RP_W6LogBatch] 'Replica QD_VAR_RISK_WEEK2'
TRUNCATE TABLE [C6StagingPeriodico].[QD_VAR_RISK_WEEK2]
INSERT INTO [C6StagingPeriodico].[QD_VAR_RISK_WEEK2]
           ([banca],
			[rete],
			[codfis],
			[piva],
			[codfid],
			[codman],
			[isp_total_risk],
			[flag_risk])
			SELECT      
			[banca],
			[rete],
			[codfis],
			[piva],
			[codfid],
			[codman],
			[isp_total_risk],
			[flag_risk]
  FROM FSEI0.FSEI0.[fsei0_pdc].[qd_var_risk_week]
  exec [C6StagingPeriodico].[RP_W6LogBatch] 'Replica QD_VAR_RISK_WEEK2'
END