audit-trail

Effective strategy for leaving an audit trail/change history for DB applications?

▼魔方 西西 提交于 2019-11-28 19:15:39
What are some strategies that people have had success with for maintaining a change history for data in a fairly complex database. One of the applications that I frequently use and develop for could really benefit from a more comprehensive way of tracking how records have changed over time. For instance, right now records can have a number of timestamp and modified user fields, but we currently don't have a scheme for logging multiple change, for instance if an operation is rolled back. In a perfect world, it would be possible to reconstruct the record as it was after each save, etc. Some info

Maintaining Referential Integrity - Good or Bad?

拈花ヽ惹草 提交于 2019-11-28 18:13:06
We are planning on introducing simple Audit Trail in our database using triggers and separate history table for each table that requires auditing. For example consider table StudentScore, it has few foreign keys (eg. StudentID, CourseID) linking it to corresponding parent tables (Student & Course). Table StudentScore ( StudentScoreID, -- PK StudentID ref Student(StudentID), -- FK to Student CourseID ref Course(CourseID), -- FK to Course ) If StudentScore requires auditing, we are planning to create audit table StudentScoreHistory - Table StudentScoreHistory ( StudentScoreHistoryID, -- PK

keeping the history of table in java

只谈情不闲聊 提交于 2019-11-28 10:39:05
I need the sample program in Java for keeping the history of table if user inserted, updated and deleted on that table. Can anybody help in this? Thanks in advance. If you are working with Hibernate you can use Envers to solve this problem. You have two options for this: Let the database handle this automatically using triggers. I don't know what database you're using but all of them support triggers that you can use for this. Write code in your program that does something similar when inserting, updating and deleting a user. Personally, I prefer the first option. It probably requires less

Compare deleted and inserted table in SQL Server 2008

北城余情 提交于 2019-11-28 09:26:32
问题 I am new to SQL Server 2008 and I need advice from all of you. I want to find out the changed value in inserted and deleted tables of the SQL Server 2008 for a table because I am currently doing the audit trail to keep the old and new value. How can I loop all the column to find out which field's value change from the deleted and inserted table? I had tried the if else statement to compare For example: create trigger trg_XXX on dbo.table after update as begin declare @oldID varchar(6), @newID

Entity Framework 6: audit/track changes

守給你的承諾、 提交于 2019-11-26 23:31:48
I have my core project in C#. I work on a database, where some tables have the columns "user_mod" and "date_mod" for sign who and when made some mods and the same with "data_new" and "user_new". My question: is there a way to centralize this and make this data inserted automatically, where I create the instance of dbContext ? If not, I will use an audit trail tool. I have seen some of these, but there is a problem: all of these, require some code in my model. But I don't want to write in my model, because if I have to change it, I will lost the mods. Is it possible use an audit trail for EF6