How to set a flag in SQL, when there is a change in value
It depends on what you want to do based on that flag.

If you only care that the row has &quot;changed&quot; at some point, then a flag might be enough.
If you care when the change happened, then a [nullable] timestamp might be more useful.
If you care if the change happens more than once, then you need a whole new table to record all of those changes, possibly even with &quot;before&quot; [and &quot;after&quot;] values.

In any case, the answer is the same - a Trigger.