Sql-server – TimeStamp Column Auto Update Upon Insert and Modification

sql server

I have been assigned with a task that is update Timestamp column of a table upon each insert or modification of table data. As per my kowledge this can posssible in case of inserts using default getdate() for the column but NOT modification without trigger.

I am looking for help on a mechanism to update timestamp column upon modification of table data without trigger, of course if possible in SQL Server.

Thanks in advance

Best Answer

Here is a list of automated features you can use to accomplish this, without using Triggers:

  1. Temporal Tables - System versioned copies of the user defined tables that track changes.

  2. Change Tracking - Automated tracking of changes for your user defined tables.

  3. Change Data Capture - Keeps track of DML changes to the specified user defined tables.

  4. Audit - Automatically tracks a multitude of actions at the server level.