CREATE PROCEDURE usp_AddProduct
(
@Barcode varchar(13),
@Caption nvarchar(50)
)
AS
BEGIN
IF LEN(@Barcode) < 13
RAISERROR('Barcode length is too short.')
INSERT INTO MyProducts (Barcode, Caption) VALUES (@Barcode, @Caption)
END
EXEC usp_AddProduct '2293891100011', 'MyProductCaption'