-- Stored procedure
CREATE PROCEDURE [dbo].[SP_PDF_UPDATENOTA]
	@IdPdf AS BIGINT,
	@Note varchar(4000),
	@idProvenienza varchar(1)
AS
BEGIN
	SET NOCOUNT ON; 
	declare @ROWCOUNT as int	 
	 UPDATE DocumentiPdf SET  note = @Note 
	 WHERE idPdf = @IdPdf   
 	 set @ROWCOUNT = @@ROWCOUNT
     INSERT INTO LogPdf (idPdf,dtstamp,idLogEvent,idProvenienza)	 
		SELECT  @IdPdf,
				GETDATE(),
				3 as idLogEvent,--"Modifica note"
				@idProvenienza
	return  @ROWCOUNT 
select * from LogEventPDf
END