question

eric_lall avatar image
eric_lall asked

In my database every table have a column EntryDate datetime default getdate() . Now my question is: how can i update this column EntryDate when any field in my table is updated. I dont want to use trigger. Thanks Eric Lall

create table Mytable name varchar(30), age int, address char(50), EntryDate datetime default getdate();
triggers
1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

if you don't want to use trigger, the UPDATE has to be done by the application itself
0 Likes 0 ·

1 Answer

· Write an Answer
Grant Fritchey avatar image
Grant Fritchey answered
If all access to write to your tables is through stored procedures, you can simply make sure that all your procedures has this built in. If access is through a known set of code, you can make sure it's built into that known set of code. But if it's completely ad hoc, the only way to make something like this work is through triggers.
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.