childrenfirst
Technical User
Hi,
I created a trigger which will launch a stored procedure whenever an existing record is edited. The trigger looks like this:
CREATE TRIGGER [tr_EditTimeOff] ON [dbo].[TimeOff]
FOR UPDATE
AS
DECLARE @EmpName AS varchar(50)
DECLARE @Manager AS varchar(50)
DECLARE @RequestID AS int
SET @EmpName = (SELECT EmpName FROM UPDATED)
SET @Manager = (SELECT Manager FROM UPDATED)
EXEC s_TimeOffAction @EmpName,@Manager
The problem is that I got an error message every time I tried to update the table since I added this trigger. The error message says:
Invalida object name 'Updated'
Can anyone tell me why I got the error message and what I should revise the trigger in order to allow update to the existing records on the table?
Thank you in advance!!
I created a trigger which will launch a stored procedure whenever an existing record is edited. The trigger looks like this:
CREATE TRIGGER [tr_EditTimeOff] ON [dbo].[TimeOff]
FOR UPDATE
AS
DECLARE @EmpName AS varchar(50)
DECLARE @Manager AS varchar(50)
DECLARE @RequestID AS int
SET @EmpName = (SELECT EmpName FROM UPDATED)
SET @Manager = (SELECT Manager FROM UPDATED)
EXEC s_TimeOffAction @EmpName,@Manager
The problem is that I got an error message every time I tried to update the table since I added this trigger. The error message says:
Invalida object name 'Updated'
Can anyone tell me why I got the error message and what I should revise the trigger in order to allow update to the existing records on the table?
Thank you in advance!!