USE Utility;
GO
IF OBJECT_ID('usp_Order_Error', 'P') IS NOT NULL
DROP PROCEDURE usp_Order_Error;
GO
CREATE PROCEDURE usp_Order_Error
	@id_client INT,
	@product_number CHAR(20),
	@qty INT,
	@qty_in_stock INT,
  @err_message CHAR(255)
AS
INSERT INTO Failed_Order_Log
(
id_client, product_number, qty_ordered, qty_in_stock, err_desc, failure_date
)
VALUES
(
@id_client, @product_number, @qty, @qty_in_stock, @err_message, GETDATE()
);