What is wrong with my code below?
It continues to throw the following error:
Server: Msg 207, Level 16, State 3, Procedure InsertProbationStopDate, Line 8
Invalid column name 'Emp_Probation'.
-- Trigger valid for multirow and single row inserts
-- and optimal for single row inserts.
CREATE TRIGGER InsertProbationStopDate
ON [dbo].[Emp_Probation]
AFTER INSERT AS
IF @@ROWCOUNT = 1
BEGIN
UPDATE Emp_Probation
SET ProbationStopDate = (DateAdd(Day, Emp_Probation.LengthOfProb, Emp_Probation.ProbationStartDate))
FROM inserted
WHERE (Emp_Probation.EmployeeID = inserted.EmployeeID) AND
(Emp_Probation.ProbationStartDate = inserted.Emp_Probation)AND
(Emp_Probation.ReasonForProb = inserted.ReasonForProb)
END
ELSE
Print 'Else'
Thanks in advance for any help!
Darrick
It continues to throw the following error:
Server: Msg 207, Level 16, State 3, Procedure InsertProbationStopDate, Line 8
Invalid column name 'Emp_Probation'.
-- Trigger valid for multirow and single row inserts
-- and optimal for single row inserts.
CREATE TRIGGER InsertProbationStopDate
ON [dbo].[Emp_Probation]
AFTER INSERT AS
IF @@ROWCOUNT = 1
BEGIN
UPDATE Emp_Probation
SET ProbationStopDate = (DateAdd(Day, Emp_Probation.LengthOfProb, Emp_Probation.ProbationStartDate))
FROM inserted
WHERE (Emp_Probation.EmployeeID = inserted.EmployeeID) AND
(Emp_Probation.ProbationStartDate = inserted.Emp_Probation)AND
(Emp_Probation.ReasonForProb = inserted.ReasonForProb)
END
ELSE
Print 'Else'
Thanks in advance for any help!
Darrick