USE [Database]

IF OBJECT_ID('[Procedures].[insert_write_off_reason]', 'P') IS NOT NULL
  DROP PROCEDURE [Procedures].[insert_write_off_reason];
GO
CREATE PROCEDURE [Procedures].[insert_write_off_reason]
  @name                         AS NVARCHAR(128),
  @inserted_write_off_reason_id AS INT = NULL OUTPUT
AS
  BEGIN TRANSACTION;
    INSERT INTO [Tables].[write_off_reasons]([name])
    VALUES (@name);
    SET @inserted_write_off_reason_id = SCOPE_IDENTITY();
  COMMIT TRANSACTION;
GO