USE [Database]

IF OBJECT_ID('[Procedures].[update_product_write_off_record]', 'P') IS NOT NULL
  DROP PROCEDURE [Procedures].[update_product_write_off_record];
GO
CREATE PROCEDURE [Procedures].[update_product_write_off_record]
  @product_write_off_record_id AS INT,
  @barcode_product_value_id    AS INT,
  @reason_id                   AS INT,
  @count                       AS INT,
  @datetime                    AS DATETIME
AS
   UPDATE [Tables].[product_write_off_records]
   SET
    [barcode_product_value_id] = @barcode_product_value_id,
	[reason_id] = @reason_id, 
	[count] = @count, 
	[datetime] = @datetime
   WHERE [id] = @product_write_off_record_id;
GO