update ipdatabase.dbo.physicalAddress set physical = inserted.physical Join deleted on physicalAddress.pk = deleted.pk Join inserted on physicalAddress.pk = inserted.pk>Thats interesting, I've never done a join on a delete statement.
>ALTER TRIGGER updateMAC ON [dbo].[astudent] FOR UPDATE AS > >/*If the nic column was updated */ > >if update(nic) >begin > declare @newMAC varchar(16), @oldMAC varchar(16) > > /* Get the new and old mac address */ > select @newMAC = nic from inserted > select @oldMAC = nic from deleted > > /* Update the ipdatabase table */ > update ipdatabase.dbo.physicalAddress > set physical = @newMAC > where physical = @oldMAC > > >end >>