CREATE procedure [C6Mart].[SRV_TRUNCATE_STAGING]
	-- Add the parameters for the stored procedure here
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	-- *** TABELLE GESTIONE ERRORE *** --
	-- TRUNCATE TABLE dbo.GLOBAL_ERROR;
	-- *** FINE TABELLE GESTIONE ERRORE *** --
	INSERT INTO LOG_ESECUZIONE
		(Nome, Inizio, Nota)
	VALUES (
		'Staging SEI',
		GETDATE(),
		'Elaborazione giornaliera'
	)
	TRUNCATE TABLE C6Staging.ALL_CF_PB;
	TRUNCATE TABLE C6Staging.ALL_CF_STATO;
	TRUNCATE TABLE C6Staging.ALL_CONSUL_ASUL;
	TRUNCATE TABLE C6Staging.ALL_PATR_TERZI;
	TRUNCATE TABLE C6Staging.ALL_PATRBF;
	TRUNCATE TABLE C6Staging.ALL_POS_CONS_CAT;
	TRUNCATE TABLE C6Staging.ALL_PROPOSTA;
	TRUNCATE TABLE C6Staging.ACBDENOTH;
	TRUNCATE TABLE C6Staging.ACBDENTRY;
	TRUNCATE TABLE C6Staging.ADBKRELAT;
	TRUNCATE TABLE C6Staging.ASSETCLASS;
	TRUNCATE TABLE C6Staging.C_BO_453FB;
	TRUNCATE TABLE C6Staging.CATINAREA;
	--TRUNCATE TABLE C6Staging.CATITEMREF; GESTITA SEPARATAMENTE
	TRUNCATE TABLE C6Staging.COMPTYPE;
	TRUNCATE TABLE C6Staging.CONO;
	TRUNCATE TABLE C6Staging.CONSAREA;
	TRUNCATE TABLE C6Staging.CONSUL;
	TRUNCATE TABLE C6Staging.INDREND;
	TRUNCATE TABLE C6Staging.INSTRBDS;
	TRUNCATE TABLE C6Staging.MACROASSETCLASS;
	TRUNCATE TABLE C6Staging.NEEDAREA;
	TRUNCATE TABLE C6Staging.OTHINTRST;
	TRUNCATE TABLE C6Staging.PORTMOD;
	TRUNCATE TABLE C6Staging.POSITION;
	TRUNCATE TABLE C6Staging.PRCONSUL;
	TRUNCATE TABLE C6Staging.QUANTIF;
	TRUNCATE TABLE C6Staging.S4_S5_S13_TRAD_UNTIL_LIV3;
	TRUNCATE TABLE C6Staging.WANAB;
	TRUNCATE TABLE C6Staging.WRENAB;
	TRUNCATE TABLE C6Staging.WSCABP;
END