Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Update trigger not firing

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-09-19 : 10:11:07
Enda writes "Hi,

Below is an update trigger that won't fire or at least doesn't seem to be firing. All it is supposed to do is just add audit information to an audit table ie. both origin table and audit table are exactly same except for constraints.

Any ideas,
Thanks.

CREATE TRIGGER updEmployee
ON dbo.Employee
FOR update AS
IF (COLUMNS_UPDATED()) > 0
BEGIN
-- Audit OLD record.
INSERT INTO EmployeeAudit
(EmployeeId,FirstName,LastName,Address1,Address2,Address3,Address4,Address5,PassportNumber)
SELECT
del.EmployeeId,del.FirstName,del.LastName,del.Address1,del.Address2,del.Address3,del.Address4,del.Address5,del.PassportNumber
FROM deleted del
END
"
   

- Advertisement -