-- ==================================================================================
-- Author:		<Ernesto Serfilippi>
-- Create date: <15.02.2019>
-- Description:	<Eliminazione righe di Immobiliare_GestionePDF>
-- ==================================================================================
CREATE PROCEDURE [C6MartPeriodicoImmobiliare].[Delete_Immobiliare_GestionePDF]
  @DataRiferimento varchar(8), 
  @Return int OUTPUT
/*
SP Parameter Comment 
*/
AS
SET NOCOUNT ON;
/*
SP Body Comment
*/
	BEGIN TRAN
	BEGIN TRY
  	DELETE FROM [C6MartPeriodicoImmobiliare].[Immobiliare_GestionePDF]
      WHERE [C6MartPeriodicoImmobiliare].[Immobiliare_GestionePDF].[DataRiferimento] = @DataRiferimento
			Set @Return=1;
    END TRY
	BEGIN CATCH     
      BEGIN
        IF @@TRANCOUNT > 0
        ROLLBACK TRANSACTION;
        Set @Return=-ERROR_NUMBER();
      END
     END CATCH
    IF @@TRANCOUNT > 0
      COMMIT TRANSACTION;