views:

80

answers:

1

Hello all,

Is there an equivalent of MySQLs on update field for SQL server?

With both DEFAULT CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP clauses, the column has the current timestamp for its default value, and is automatically updated.

What I am looking for is to have a date/time field and every time I update a record it updates the field with the date/time it was updated automatically?

If it doesn't exist, I guess I'll have to go manual.

Thanks all

+3  A: 

You can do this in a trigger. I'm not sure if this is what you mean by "manual"

Jeremy
JUst make sure you write the trigger so that it can handle multiple reocrd updates.
HLGEM