How can I control that only specific columns of a table will be updated?
My method is : create instead of update trigger for these tables and control for update only updatable columns and if updated, non updatable column raise error with an appropriate message.
Yes you can use triggers to achieve that but don’t use
INSTEAD OFtrigger.You can better use
FOR UPDATEtriggers because you don’t have to rewrite the whole update query. You only want to deny not allowed updates. If an action is allowed you don’t throw an error so the data will be updates as usual.Example:
You also can make use of
Stored Proceduresto control the update of certain tables.