Hello I'm trying to create a stored procedure to quickly add contacts. I have multiple tables and joined them accordingly. My parameters are StudentEmail,EmployeeName,ContactDetails, and ContactType. I'm having trouble with my insert into statement if anyone can help me out.
Drop Procedure if exists usp_addQuickContacts
Go
Create Procedure usp_addQuickContacts
@StudentEmail nchar(50) = NULL,
@EmployeeName nchar (50) = NULL,
@ContactDetails nchar (50) = NULL,
@ContactType nchar(50) = NULL
AS
Begin
Insert Into StudentContacts
(
ContactID,
StudentID,
ContactTypeID,
ContactDate,
EmployeeID,
ContactDetails
)
From StudentInformation inner join StudentContacts
On StudentInformation.StudentID = StudentContacts.StudentID
Inner Join Employees
On StudentContacts.EmployeeID = Employees.EmployeeID
End
Go