Are audit fields inherent with each table

Are audit fields inherent to each db entity that is created?  Or do those fields need to be explicitly set in each db entitiy?

Hi Peter,

I am not sure if I understand the question correctly with the limited info. Could you please elaborate? 

If you are asking about the audit history of the application tables, then no there is nothing out of the box and needs to be done and managed explicitly.

Akshay Puri wrote:

Hi Peter,

I am not sure if I understand the question correctly with the limited info. Could you please elaborate? 

If you are asking about the audit history of the application tables, then no there is nothing out of the box and needs to be done and managed explicitly.

Thanks for replying Akshay

Yes I want to set created by, created date/time, modified by, modified date/time for each db table.  I thought maybe this was inherent when you create a table.  Based on your reply, it doesn't seem to be the case.  Are there specific attributes that need to be set in each field that can be set to achieve this?


Solution

Hi Peter,

These are explicit columns to your tables and will have to be set while you create or update your entities just like other attributes. You might not have them for all the tables, e.g. a master table which is not your transnational table. 

If you want to maintain the history of the records automatically then I know of a solution which is specific to SQL Server 2016 or later. There is a concept called Temporal Tables https://docs.microsoft.com/en-us/sql/relational-databases/tables/temporal-tables?view=sql-server-ver15

I have done this for the on-premise installation. Not sure if this can be done for PaaS.

Solution