EchoAlertcom
IS-IT--Management
Hello,
I need some simple help please.
I need a trigger that will update the OpenedDate column when the Opened INT field is updated on a specific row. I'm affraid what I have below will update the OpenedDate column for ALL the records not just the record that the Opened INT was updated.
I would appreciate any suggestions.
Thanks,
Steve
I need some simple help please.
I need a trigger that will update the OpenedDate column when the Opened INT field is updated on a specific row. I'm affraid what I have below will update the OpenedDate column for ALL the records not just the record that the Opened INT was updated.
I would appreciate any suggestions.
Thanks,
Steve
Code:
CREATE TRIGGER [trgOpenDate]
ON [dbo].[Addresses]
FOR UPDATE
AS
IF UPDATE(Opened)
Begin
UPDATE [dbo].[addresses] SET OpenedDate = GetDate()