USE [Database]

IF OBJECT_ID('[Procedures].[insert_product_value]', 'P') IS NOT NULL
  DROP PROCEDURE [Procedures].[insert_product_value];
GO
CREATE PROCEDURE [Procedures].[insert_product_value]
  @product_id   AS INT,
  @attribute_id AS INT,
  @value        AS NVARCHAR(128),
  @inserted_product_value_id INT = NULL OUTPUT
AS
  BEGIN TRANSACTION;
    INSERT INTO [Tables].[product_values]([product_id], [attribute_id], [value])
    VALUES (@product_id, @attribute_id, @value);
    SET @inserted_product_value_id = SCOPE_IDENTITY();
  COMMIT TRANSACTION;
GO