I need to set a timestamp (actual server system time) on each inserted row.
There is a primary key column named "doc_id"
I try using this trigger:
Create Trigger mytrigger On mytable
For Insert As
Update mytable
Set mystamp = getdate() where doc_id in (select doc_id from inserted)
For some reason, all inserted rows still have a value of "1.1.1900 00:00" in the column "mystamp."
What is wrong with what I am doing???
There is a primary key column named "doc_id"
I try using this trigger:
Create Trigger mytrigger On mytable
For Insert As
Update mytable
Set mystamp = getdate() where doc_id in (select doc_id from inserted)
For some reason, all inserted rows still have a value of "1.1.1900 00:00" in the column "mystamp."
What is wrong with what I am doing???