-- Schema: C6Mart
-- Stored Procedure: DM_ESITI_CARICAMENTI

-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE procedure [C6Mart].[DM_ESITI_CARICAMENTI]
AS
BEGIN

	SET NOCOUNT ON;

	DECLARE @ID_ELAB INT
	SET @ID_ELAB = C6MART.GETIDELAB()

	TRUNCATE TABLE C6MART.ESITI_CARICAMENTI

	INSERT INTO [C6Mart].[ESITI_CARICAMENTI]
           ([PROGR]
           ,[DATA_INIZIO]
           ,[DATA_FINE]
           ,[ESITO]
           ,[NOTE]
           ,[ID_ELAB])
	SELECT 
		NULL AS PROGR,
		NULL AS DATA_INIZIO,
		NULL AS DATA_FINE,
		NULL AS ESITO,
		NULL AS NOTE,
		@ID_ELAB AS ID_ELAB
	FROM C6STAGING.CATITEMREF
	WHERE 1=0

END



