Is it possible to create a trigger that will check if a specific field is being set to NULL (from a single-line or multi-line update), and if it is, to revert that field back to its initial value?
I've searched on the site but not found anything that matches my exact requirements.
A bit of background:
We have two applications (a time management web app and microsoft project server) sending updates to each other about the resources in our organisation. When a change is made in either system, it sends that update to the other system. However, there are certain fields that only exist in the time management web app (table name resource
), and MSP server is forcing one of these fields (field name GLMaskingValue
) to NULL
with some of its updates (not all, as far as I can tell).
I have no access to the code, just the web app database, and I don't want to make the whole update statement fail (which I gather I could do using table constraints) - I just want to revert this one field back when and if someone tries to change it to NULL
.
I'm going down the route of triggers but there may well be a much better way of doing this - if so please enlighten me!