USE [Database]

IF OBJECT_ID('[Procedures].[update_barcode]', 'P') IS NOT NULL
  DROP PROCEDURE [Procedures].[update_barcode];
GO
CREATE PROCEDURE [Procedures].[update_barcode]
  @product_id INT,
  @barcode    BIGINT
AS
  BEGIN TRANSACTION;
  SET NOCOUNT ON;

  UPDATE [Tables].[products]
  SET [barcode] = @barcode
  WHERE [id] = @product_id

  COMMIT TRANSACTION;
GO
