Question: Need help with this: Write a script that creates and calls a stored procedure named spInsertCategory. First, code a statement that creates a procedure that

Need help with this:

Write a script that creates and calls a stored procedure named spInsertCategory. First, code a statement that creates a procedure that adds a new row to the Categories table. To do that, this procedure should have one parameter for the category name.

Code at least two EXEC statements that test this procedure. (Note that this table doesn't allow duplicate category names.)

Not sure what I'm missing in my EXEC statement

CREATE PROC spInsertCategory @CategoryName VARCHAR(100) AS

BEGIN INSERT INTO Categories (CategoryName) VALUES (@CategoryName); END DECLARE @CategoryName VARCHAR EXEC spInsertCategory @CategoryName = 'Vegetables';

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!