﻿create PROCEDURE [dbo].[sp_deleteReportArchiviati]
	@IdPdf AS BIGINT,
	@idProvenienza varchar(1) 
AS  
BEGIN
 BEGIN TRANSACTION    
declare @dtstamp as datetime
set @dtstamp = GETDATE()
 delete 
 from ImagePdf 
 WHERE idPdf = @IdPdf
 INSERT INTO LogPdf 
 	SELECT @IdPdf,@dtstamp,
	7 -- Eliminazione fisica immagine report
	,@idProvenienza  
--**************************************************************************************
 COMMIT TRANSACTION	  
END