USE [Database]

IF OBJECT_ID('[Procedures].[update_product_type]', 'P') IS NOT NULL
  DROP PROCEDURE [Procedures].[update_product_type];
GO
CREATE PROCEDURE [Procedures].[update_product_type]
  @product_type_id AS INT,
  @parent_id       AS INT = NULL,
  @name            AS NVARCHAR(128)
AS
 UPDATE [Tables].[product_types]
 SET
   [parent_id] = @parent_id,
   [name] = @name
 WHERE [id] = @product_type_id;
GO

