Greetings,
I have a table called audit that contains the fields:
- codigo_auditoria INT
- fechahora_auditoria DATETIME
- tabla_auditoria VARCHAR
- operacion_auditoria VARCHAR
- usuario_auditado VARCHAR
- campo_actualizado VARCHAR
- valor_antiguo VARCHAR
- valor_nuevo VARCHAR
and I want to audit different tables in that same table by means of triggers, but I do not know how to do in the fields "campo_actualizado, valor_antiguo y valor_nuevo"
the bd autodetecte which field change and what is its old and new value.
NOTE: I do not want to do it in a fixed way because that way I would have to make more tables (one for each table to be audited)
Thank you in advance