I'm working on an application where I need to save basically :
Right now I have these fields in all the tables in my database. But I feel like there should be a better way to do this.
I agree with Josh, it it's just those 4 attributes. If it goes beyond that and you want to see all column values before and after, you should consider a different approach.
i think this is the best ways to go, to stick those fields in the table of whatever is being created/updated. It's clear on whats being created/updated, and if that table is already being updated anyways, adding in those 4 fields won't create any kind of performance issue.
Hal Lesesne
I'm getting more and more convinced that an appending or immutable model is the best solution if auditing is necessary.
New row for each change and a consolidating view (or other top type retrieval method) that returns the latest change.