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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started