I have a database model where each and every table has a datetime field named _CDateTime.
When a row is INSERTed a default value of GETDATE() is written by SQL Server to this field.
When an UPDATE is issued on a row on the other hand the _CDateTime field is not automatically updated by SQL Server.
I know that I could use the timestamp date type, but that doesn’t convey any time information (contrary to it’s name).
Another solution would be to write a trigger for each and every table, but that is much work.
So the question is: Is there any global way that works like a global trigger that fires when a row is updated in one of the database tables and automatically sets the _CDateTime field to the current date and time?
PS: The answers to this question suggest that there is no such thing: Multi table Triggers SQL Server noob
you need either an UPDATE trigger to apply getdate() to the _CDateTime field or you must submit _CDateTime = getDate() on each single update. There is no automatic way of doing that