I am getting this error:
Msg 201, Level 16, State 4, Procedure NewEmployee, Line 0
Procedure or function 'NewEmployee' expects parameter '@LastName', which was not supplied.
Here is my code:
CREATE PROCEDURE NewEmployee (
@LastName nvarchar(20)
,@FirstName nvarchar(10)
,@HireDate datetime
,@Birthdate datetime
,@Title nvarchar(30))
AS
BEGIN
INSERT INTO Employees (LastName,FirstName,HireDate,BirthDate,Title)
VALUES (@LastName, @FirstName, @HireDate,@Birthdate,@Title)
End
GO
This is what I am trying to do.
I need to write a procedure to insert a new employee into the table with their last and first names, hire and birth dates, and job title.
I’m trying to add the following information by running the procedure:
Last Name: Beesley
First Name: Pam
Hire Date: Current Date
Birth Date: 12/30/1972
Title: Receptionist
Home Phone: 330-555-5555
It seems you are not passing right number of parameters while exec the procedure can you share the exec statement ?