﻿CREATE PROCEDURE [dbo].[SP_PDF_ARCHIVEIMAGE]
	@IdPdf AS BIGINT,
	@idProvenienza varchar(1) 
AS
BEGIN
BEGIN TRANSACTION
declare @dtstamp as datetime
set @dtstamp = GETDATE()
UPDATE DocumentiPdf SET [idArchivio] = 'A'  WHERE idPdf = @IdPdf
--UPDATE ImagePdf SET [image] = NULL WHERE idPdf = @IdPdf
INSERT INTO LogPdf (idPdf,dtstamp,idLogEvent,idProvenienza )	 
		SELECT  @IdPdf,
				@dtstamp,
				9 as idLogEvent,
				@idProvenienza 
 COMMIT TRANSACTION	   
end