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)
 Trigger's help

Author  Topic 

uri dimant
Starting Member

16 Posts

Posted - 2001-09-09 : 11:02:39
Hello! i try to figure trigger for update
CREATE TRIGGER [Audit] ON [W_WorkDetails]
FOR UPDATE
AS
IF UPDATE (col1) OR UPDATE(col2)
BEGIN
INSERT INTO W_AUDIT SELECT TOP 1 d.oldVal,i.NewVal,GETDATE(),UserName,d.projectid,W_machines.machinename
FROM DELETED d INNER JOIN INSERTED i
ON d.workid =i.workid INNER JOIN W_machines ON i.machinecode =W_machines.machinecode

END
my proble is when i open w_audit i see few records(for example i have 5 machines,i see 5 records).I want to see only one record that was updated. thanks for any help

   

- Advertisement -