Okay what I'd like to do is when a value is updated in one table I would like to add a value into another table
This is what I've come up with and it obviuosly doesn't work, could you give me some pointers.Code:CREATE TRIGGER dbo.gmprospectdate ON contact1 FOR UPDATE AS DECLARE @key1 varchar(255), @ACCOUNTNO varchar(20) SELECT @key1 = key1, @ACCOUNTNO=ACCOUNTNO FROM inserted where key1 is not null case @key1 when 'Prospect' then update contact2 set uprospect = getdate() where ACCOUNTNO = @ACCOUNTNO when 'Trial' then update contact2 set UFCSDATE = getdate() where ACCOUNTNO = @ACCOUNTNO when 'Client' then update contact2 set USTARTDATE = getdate() where ACCOUNTNO = @ACCOUNTNO end
Cheers all.




Reply With Quote