July 24, 2019 at 6:45 pm
Hello everyone.
Could you please remember me how to catch the time when some table got updates in a particular column?
MS SQL Server 2016
Thanks a lot in advance.
July 24, 2019 at 7:39 pm
Trigger.
--Jeff Moden
Change is inevitable... Change for the better is not.
July 25, 2019 at 8:50 am
Are you only checking for a single column changing? You can audit/use Extended Events for this, but if you want to capture the time, a trigger will do this. You'll want to compare the inserted and deleted tables for the column to determine a change and update some other value. However, if you do this for one column what about others? Will your requirements change to know when the row was updated? Or the history of the row?
There are ways to do this, but think a little deeper about what things might come about if you know when a column changed for a row. Will there be other requirements?
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply