When I run this stored procedure using this:
EXECUTE RecipeDetails.sp_InsertRecipe
@title='gumbo',
@introdution='intro',
@ingredients='onion',
@difficulty='easy',
@prepTimeHour=null,
@prepTimeMinute=null,
@inactiveTimeHour=null,
@inactiveTimeMinute=null,
@servings=null,
@photo=null
I get an error saying
Msg 201, Level 16, State 4, Procedure sp_InsertRecipe, Line 0
Procedure or function
‘sp_InsertRecipe’ expects parameter
‘@introduction’, which was not
supplied.
Can some please advise me as to why it’s saying “introduction” isn’t a valid column name?
I have the following SQL Server stored procedure:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [RecipeDetails].[sp_InsertRecipe]
@title varchar(50),
@introduction varchar(255),
@directions varchar(2200),
@ingredients varchar(2200),
@difficulty varchar(6), or "expert"*/
@prepTimeHour tinyint,
@prepTimeMinute tinyint,
@inactiveTimeHour tinyint,
@inactiveTimeMinute tinyint,
@servings tinyint,
@photo varbinary(MAX)
AS
BEGIN
SET NOCOUNT ON;
INSERT INTO RecipeDetails.Recipe (title, introduction, ingredients, difficulty,
prepTimeHour, prepTimeMinute, inactiveTimeHour, inactiveTimeMinute, servings, photo)
VALUES (@title, @introduction, @ingredients, @difficulty, @prepTimeHour, @prepTimeMinute,@inactiveTimeHour, @inactiveTimeMinute, @servings, @photo)
END
GO
It’s a simple typo: see your call to the stored proc:
You’ve supplied a parameter
@introdution– but not@introduction(you’re missing a “c” in that name there)