-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [C6StagingPeriodico].[RP_POPOLAMENTO_WSMOV_CONTRATTO_SCARICO] 
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
 --troncare la tabella esistente 
 truncate table [C6StagingPeriodico].WSMOV_CONTRATTO_SCARICO
 -- popolamento tabella 
 insert into [C6StagingPeriodico].WSMOV_CONTRATTO_SCARICO
 select 
	   [WSMOV_PRODOTTO]
      ,[WSMOV_OPERAZIONE]
      ,[WSMOV_FIRMA_DIGITALE]
      ,[WSMOV_CONTRATTO]
      ,[WSMOV_PROGRESSIVO]
      ,[WSMOV_DATA_ESEGUITO]
 from [SYSC].[ITIMISYSCDSN].[F].[WSMOV]
 where WSMOV_DATA_ESEGUITO >= '20150708'
 and wsmov_data_eseguito not like '99%'
END