﻿-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE procedure [C6Mart].[DM_CODIFICA_PIRAMIDI]
AS
BEGIN
	SET NOCOUNT ON;
	DECLARE @ID_ELAB INT	
	SET @ID_ELAB = C6MART.GETIDELAB()
	TRUNCATE TABLE C6MART.CODIFICA_PIRAMIDI
	INSERT INTO [C6Mart].[CODIFICA_PIRAMIDI]
           ([ID_PIRAMIDE]
           ,[DESCRIZIONE]
           ,[NOTE]
           ,[ID_ELAB])
	SELECT 
		NULL AS ID_PIRAMIDE,
		NULL AS DESCRIZIONE,
		NULL AS NOTE,
		@ID_ELAB AS ID_ELAB
	FROM C6STAGING.CATITEMREF
	WHERE 1=0
END