
May 30th, 2003, 06:13 AM
|
|
Junior Member
|
|
Join Date: May 2003
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
UPDATE Trigger fired twice?
I have writen the following UPDATE trigger in SQL Server:
CREATE TRIGGER LOG_UPDATE ON EMPLOYEE
AFTER UPDATE
AS
INSERT change_log(table_name,operation,key1)
SELECT 'EMPLOYEE','U',EMP_ID
FROM inserted
I want a record to be inserted in the CHANGE_LOG table when an update occurs at the EMPLOYEE table. But the problem is two records are getting inserted in CHANGE_LOG table instead of one. It seems as if the UPDATE trigger is fired twice. Please suggest a solution.
Thanks,
Vibha
|