No, unfortunately the insertion date or the last update is not saved automatically with each entry.
To do this, you need to create two datetime columns in your table (for example, CreatedOn , UpdatedOn ), and then set CreatedOn = getdate () in INSERT , and set UpdatedOn = getdate () in the UPDATE trigger .. p>
CREATE TRIGGER tgr_tblMain_Insert ON dbo.tblMain AFTER INSERT AS BEGIN set nocount on update dbo.tblMain set CreatedOn = getdate(), CreatedBy = session_user where tblMain.ID = INSERTED.ID END
I also like the CreatedBy and UpdateBy varchar (20) columns that I set to session_user or update using other methods. p>
source share